[General] How to set damage of a unit on % hp like this?

Level 13
Joined
Jan 6, 2015
Messages
824
I want a units damage to be something like :

Every 2% of missing hp of "SuperUnitX " grants him 1 damage. How do I do this ?

I dont want to exceed my limit of 10 Levels for hidden abilities.

I will be really grateful and +rep the one who solves this problem.
 
Level 23
Joined
Aug 1, 2013
Messages
4,657
Add your SuperUnitX to a group.
All units inside that group have that ability (probably will be a very empty group with either 1 or 0 members but still).
Every 0.5-1.0 seconds of gametime (you can decide what number you want but dont use a value below 0.5 or higher than 1.0), you loop through all units of the group.
You calculate how much bonus damage they should gain and set the bonusdamage from the BonusMod to that amount.
 
Top