Skill formula similar to Moxie ability from Pokemon?

I'm looking to use the Skill tab's Formula box to create a skill that deals damage and the result acts similar to Moxie from the Pokemon series. The Moxie ability in Pokemon boosts the user's attack when they knock out an enemy.


I'm looking to do something like this: 


User attacks to deal damage. If user incapacitates enemy, then apply ATK buff for 5 turns.
I don't think an effect like that is possible without some kind of plugin.  Try Yanfly's Skill Core:


http://yanfly.moe/2015/10/13/yep-8-skill-core/


And this code in the note box:


<Post-Damage Eval>


if (target.hp <= 0){


user.addBuff(2, 4)


}


</Post-Damage Eval>


What this does is check after the damage has been done to see if the target is dead.  If so, it buffs the parameter 2 (attack) for 4 turns.  Change the second number in the parentheses after user.addBuff to the number of turns you want the buff to last.

Original thread: https://forums.rpgmakerweb.com/threads/skill-formula-similar-to-moxie-ability-from-pokemon.64386/