A state that buffs the user when hit

I'm looking to make a state which applies a buff to the user whenever hit, the user can only be buffed 6 times with the state and it's only being hit by enemy attacks that increase it, so things like bleed I don't want to have an affect on it. How would i go about doing this?
You'd use Yanfly's Buffs & States Core, and give the state a Custom Respond Effect notetag.

You didn't say which parameter you want buffed, so you can use the pinned thread in the JavaScript forum of common script call for MV (or just Google it) to see the code you put in there to apply the buff.
You'd use Yanfly's Buffs & States Core, and give the state a Custom Respond Effect note tag.

You didn't say which parameter you want buffed, so you can use the pinned thread in the JavaScript forum of common script call for MV (or just Google it) to see the code you put in there to apply the buff.
How can I go about having it so that it only does the buff 6 times per battle, resetting after the battle

Original thread: https://forums.rpgmakerweb.com/threads/a-state-that-buffs-the-user-when-hit.156321/