globals
private constant real HealPerLevel = 50.00
private constant integer SpellID = 039;A000039;
endglobals
function Something takes nothing returns nothing
call SetWidgetLife(GetSpellTargetUnit(), GetWidgetLife(GetSpellTargetUnit()) + HealPerLevel * GetUnitAbilityLevel(GetTriggerUnit(), SpellID))
endfunction
The best method I know is similar to this.Unfortunately there is no native to get the mana cost of a spell. The only work around is a small "trick":
A trigger that fires when the unit starts casting (-->mana didnt decrease)
--> save the current mana in some variable, attach the variable to the unit,...
A trigger that fires when the unit ends casting or starts the effect of an ability (--> mana got subtracted)
--> mana saved in variable - current mana = manacost of spell
Or when you are sure that you won't change the manacosts anymore and they have some arithmetic growing values then you can ofc do it like SineCosine proposed.