Quote from ShefkiThe second argument you're passing to Power() is rage or mana which isn't defined in the text so it's passing nil, which is the same as passing no 2nd argument at all. The power type is specified by passing an integer that corresponds to the power type.
However, even replacing the proper constants (mana with SPELL_POWER_MANA and rage with SPELL_POWER_RAGE) won't fix your code because Power() probably returns 0 for the current power type and 0 evaluates to true in Lua.
You should just check the power type directly with UnitPowerType().
E.g. UnitPowerType(unit) == SPELL_POWER_MANA
Thank you for the very fast reply! Works like a charm.