EDIT: Trigger Action Try Starts from Set Caster[MaxIndex] = Caster[Index]
Remove the for each maxindex from 1 to index and do action
Regen Stop
Events
Unit - A unit Stops casting an ability
Conditions
(Ability being cast) Equal to Heal
Actions
Set Caster[MaxIndex] = Caster[Index]
Set Life[MaxIndex] = Life[Index]
Set Index = (Index - 1)
Set MaxIndex = (MaxIndex - 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Index Equal to 0
Then - Actions
Trigger - Turn off Regen Loop <gen>
Else - Actions