Yanfly Skill Request(Gain health when linked monster is attacked)

The skill in question would work like this
1.A uses Spell to link to monster (Using a state)
2.When the monster is attacked by C during the duration of the state/link, A gains a percent of the damaged health as healing.
3.When the spell (State) wears off, A and the monster are no longer linked.
I'm using
Yanfly Battle core,Yan Skill Core,Yan Buffstates, Yan Action Sequence 1-3
And a few other battle plugins.
Link to yanfly's plugins

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-skill-request-gain-health-when-linked-monster-is-attacked.109182/