How to make a damage link state?

i want to make a state that makes 2 actors take the same damage, so if actor 1 is attacked by a monster and takes 25 damage, then actor 2 also takes 25 damage, same thing with healing and states and such

i tried to use the code found on this thread (https://forums.rpgmakerweb.com/index.php?threads/linked-state.151010/) but i wasnt able to get it to work properly for some reason
Welcome!

The code should work, so post screenshots of how you set it up (the state in the database, the skill that applies it).
Welcome!

The code should work, so post screenshots of how you set it up (the state in the database, the skill that applies it).
After a few days without internet, I'm back. Also thanks for the welcome.
So, I was able to fix the issue by changing the user part to target.

var link=$gameParty.aliveMembers().find(member => member!=target && member.isStateAffected(143));

is what i used that worked, although it doesn't link anything else other than damage like states or healing, is there a way to do that?
Oh, right, also I forgot to mention something, it doesn't exactly link the damage, it just deals damage to the other party member aswell, like it's just attacking them with the same skill, rerolling the formula, so they don't take the same damage.
Thanks, I corrected the user to target.

It should deal all Effects of the skill to both targets, the apply() function is what calls them.

As far as the amount of damage, that's possible, but it would make the code more complicated in the state because you'd have to do all of the things (hit, damage, all the Effects) that's done by apply() inside the state instead.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-a-damage-link-state.153606/