attack formula variables

Id like an attack to grab the Id of the target and save it in a variable so my state checking method can read it and apply/remove states.

The goal is an attack that binds the user and target together and both lose the state if it falls off one of them (via damage)

Multiple users can be inflicted and have their own specific marked target so i need something to attach the target to the attacker and vice versa.
Mmm... How about trying to use a little trick in your damage formula?

Code:
a.atk * 4 - b.def * 2 if v[2] = b.enemy_id || b.id()

Using this formula inside a skill in your database will actually do that:

- First of all, just write the damage formula you want to use for the skill. In the example above, I have used the default one of the attack skill. If you don't want any damage, you can just write 0.

- After that, I have written a "fake" if condition (that will be always true) that actually sets in the variable data array on the index 2 (That is the Variable ID. You can change it with the ID you prefer) the TARGET (b) enemy_id (if the target is an enemy) OR (||) if the target is an actor the actor id (b.id()).

Using this method, you can execute the code for storing the ID in a variable directly in the damage formula 😂
Fantastic thankyou

Original thread: https://forums.rpgmakerweb.com/threads/attack-formula-variables.114928/