Attack and then add buff to the attacker (Skill help)

Like the name says, I'm trying to make an attack for an enemy. The premise is that the enemy attacks with this Slash n Dash skill before gaining evasion. The problem with this is that the attacker doesn't gain the evasion buff, the person they attacked gets the buff instead. If anybody knows what to change so the enemy gains the evasion rather than the player, that'd be perfect.

Below is pictures of the skill and the state in question.
all effects go automatically to the target, no matter what you do there.

you have two ways to distribute effects to different sides: either damage formulacoding or plugins for action sequences.

damage formula coding requires some bit of javascript knowledge and has some limitations.

action sequences are the better solution but require a plugin to be implemented (for example the yanfly plugins)
The effects going automatically to the target I know, getting them to the attacker is the hard part.
However I do have some of the Yanfly plugins installed. Which ones should I use to make my skill work?
With YEP_SkillCore you could try adding something like this to your skill's Note field:

<Post-Damage Eval> user.addState(123); </Post-Damage Eval>
You'll need to replace 123 with the ID of your "Evasion" state. A state's ID is the number next to it in the list on the left (which you have cropped out of your screenshots). Do not include any leading zeroes, e.g. write 21, not 0021.
Will do and understood! Thanks for the help you two!

If I run into any more problems, I'll be sure to drop them below

Update: Sadly, it didn't work. After adding the code to the note of the skill with the apropriate State-number, it still added the state to the attacked instead of the attacker. I even removed the ( ) arund 13 to see if that helped, which it didn't, so I put it back. If you see a problem with anything, please tell.

I also know that the order the Yanfly plugins matter so if there's a problem with the order of it, I dropped a screenshot of my current plugins below as well.
Looks like your Yanfly plugins are in the recommended order, so that's good!

I notice you still have the Add State effect on your skill. So in theory, it will apply the state to the target (from the effect) and the user (from the notetag).

Maybe the user is getting the state, but they are not being refreshed properly? The engine usually only checks the target for showing results. YEP_BattleEngineCore might affect that too, I haven't tested. You could try adding this line to the tag, immediately after user.addState(13);

BattleManager._logWindow.displayAddedStates(user);
I added the line of code and the enemy IS getting the effect! It just never showed up! Problem still persists that the attacked, in other words the player, also gains the effect. Any ideas on how to fix that?

Update: I fixed it myself! 😀
All I needed to do was the remove the effect right after applying it. Granted, the battle text says that the player stops evading but I can live with it if it means the enemy starts dodging.

Thank you for all the help!
Alternatively you can just remove the Add State effect from the skill's Effects list. The notetag and the Effects are completely separate things: the tag should work even if the Effects list is empty.
That made the effect disappear on the player and removed the text in the battle box! Thank you so much for helping me yet again!

Original thread: https://forums.rpgmakerweb.com/threads/attack-and-then-add-buff-to-the-attacker-skill-help.175515/