Change Variable When Healing Others

In my game, I have a variable called Empathy that affects the storyline. As empathy increases, the connection between the two main characters increase, and their magic becomes stronger. I want to figure out a way to increase the Empathy variable when one main character heals the other, but not when the characters heal themselves. Anyone have any ideas?
Yanfly buffs and states core should do the trick.
Maybe you can also use the damage formula for it. Try something like this (change the 17 to the id of your Empathy variable):

if (a !== b) {$gameVariables.setValue(17, /v[17] + 1);}; your formula for healing here

I can't test it right now, so I'm not sure if it will work.
That is assuming you only have two actors, and that you cannot heal enemies, and that enemies cannot heal each other.

If any of those things are possible, you'd have to add a check that a and b are both the two actors you're interested in.

Original thread: https://forums.rpgmakerweb.com/threads/change-variable-when-healing-others.81519/