Adding states to the user when he/she's attacking

Is it possible to add states to the user when he/she's attacking the enemy?
For example : I have a skill that attacks an enemy and increases the user's DEF simultaneously.

Cheers.
You can with Yanfly's Skill Core Plugin.

Just use the notetag:

<Post-Damage Eval>
user.addState(stateID);
</Post-Damage Eval>

Replace stateID with the ID of the state you want to add to the user.
Or simply in the damage formula:

a.addState(stateId); your damage formula goes here
Thanks Naveed and Lady! It works.

Original thread: https://forums.rpgmakerweb.com/threads/adding-states-to-the-user-when-he-shes-attacking.81901/