constant native IsUnitInGroup takes unit whichUnit,group whichGroup returns boolean
This function tests if a unit is in a group and returns the result.
whichUnit is the unit you want to test.
whichGroup is the group you want to check he is in.
It returns a boolean value of true if the unit is in the provided group and false otherwise.
A group is a set of units. A set is an unorder collection where every element is unique.
As you damage a unit, you are after adding it to the group.
However, before you damage a unit (and thus add it to the group) you are after checking if it is already in the group.
If the unit already is in the group, it must have been damaged already by the ability as that is the only way units get added to the group.
If it is not in the group, the unit has not been damaged thus you can damage it but you then have to add it to the group to prevent it from being damaged again.
The group must be unique for every instance of the spell. After the spell finishes the whole group can be discarded (Destroyed or Recycled).