Adding buff on hit

Hello Folks!

I can't figure out how to add a self buff on hit, i find it annoying when an attack only buffs so i wanted to make attack buffs like

Poison Attack: Attacks and has a chance to poison the enemy and adds poison to your weapon

But i thought it would be easyier as it is because i only add the buff to the enemy, this was a problem i knew already but i couldnt figure out a way to work around.

Thank you for your help!

 
Add a.add_state(ID) to your damage formula to apply a state on yourself while attacking.

Example: a.add_state(3); a.mat * 1 

This will deal damage and add state to the user.
Wow thats great thank you i should look up more about those formulas, is there any great tutorial or explaination page? :3
I'm not using tutorials too much, but I found this one, perhaps you'll find some interesting things here. =)

Making Custom Formulas

Original thread: https://forums.rpgmakerweb.com/threads/adding-buff-on-hit.42393/