LINKED state

How would i go about making a state that links actors, as in, if actor 1 gets healed, so does actor 2, and if actor 1 gets hit, so does actor 2.
I've searched for a bit and i havent found anything really helpful
I would use Yanfly's Buffs and States Core. Give the state these notetags:
Code:
<Custom Respond Effect>
if (!$gameSwitches.value(switchId))
{
    var link=$gameParty.aliveMembers().find(member => member!=target && member.isStateAffected(stateId));

    if (link)
    {
        $gameSwitches.setValue(switchId, true);
        this.apply(link);
    }
}
</Custom Respond Effect>

<Custom Conclude Effect>
$gameSwitches.setValue(switchId, false);
</Custom Conclude Effect>

where all instances of switchId are the ID of an available switch, and stateId is the ID of this state.

I haven't tested it, let us know if it doesn't work correctly.
ok, well, im kinda confused
it didnt work but thats probably because of my incopetence, do i have to make anything in the skill notes or something like that?
No, this should work without any skill notetags. Double check that you have replaced all instances of switchId and stateId. Double check that the switch is actually available and not used for anything else.
For this to work the state needs to be applied to both linked party members. If only one party member has the state, this code will indeed do nothing.
If all this fails, post screenshots of your skill and state setup. And make sure your Yanfly plugins are in the proper order.
Did you install the plugin I said you needed? Without that, just putting code into a note field won't do anything.

Also, any time you change anything in your project, you need to start a new game, you can't load a save.

Finally, it's best to test in a real game once plugins get involved. I would expect this to work in the battle test, but many plugins don't work correctly there so it's always better to do it in the play test.
Ohhhh, the problem was that it didnt work on battle tests, that makes more sense, thank you

Original thread: https://forums.rpgmakerweb.com/threads/linked-state.151010/