Setting up a skill that marks a target that then heals allies

Hi there guys and gals.
Im looking to put together a skill and im kinda stuck.
I want to make a skill that targets one or maybe all enemies (not sure how balanced it will be if it targets all)
causing a state that if the actors then attack the marked target(s) they heal for a % of done damage.

Maybe ill figure it out but
any ideas or help would be appreciated!
In it's most basic form you just need the skill to apply the state. Then all of your damaging attacks then need to have a check to see if the target is affected by that state and if they are heal the user ie:

Code:
if (b.isStateAffected(x)) a.gainHp(0.2* (a.atk*4 - b.def*2)); a.atk*4 - b.def*2;

This will heal the user by 20% of the damage before variance/elemental resistances etc.
Awesome! That works great. Thanks a ton!

Original thread: https://forums.rpgmakerweb.com/threads/setting-up-a-skill-that-marks-a-target-that-then-heals-allies.107605/