My idea isn't that good since it has far too many problems but unless you specify the recover rate by cvar (and the amount to heal) then it should be impossible as far as I know to do it well.
About your wc3 comment you would be able to check if they are within range of someone else and are the correct 'race' with correct ability before giving them the HP.