MV Count-Based States (as opposed to turn-based)?

Something I would like to do for my game is changing the fundamental way states in battle are handled so that, instead of states being depleted turn-by-turn, they're depleted based upon "every time they have an effect." For example, let us say that Character X obtains a defense buff. Instead of lasting for three turns, X's defense buff instead lasts for three hits (or five hits, or whatever ends up being balanced for the game).

Small explanation of motive: This changes the fundamental opportunity cost of buffs in such a way that buff effectiveness actually scales downwards with enemy count instead of upwards -- as well as giving AoE debuffs a particularly strong niche -- which I feel would be appropriate for my game.

Some buffs/debuffs would still end up pseudo-turn-based anyway, like DoT/Regen states or Speed buffs/debuffs, but I think this communicates the idea fairly well. Anyway, with all that said, if there is a plugin out there with the capability to make this happen, I either haven't found it yet or haven't realized the full potential of one of the plugins I already have. I don't, for example, see a way to implement this using Yanfly's States Core or State Protection plugins (beyond making States not naturally deplete, which shouldn't be difficult). I don't think it's eventable, either, without taking exorbitant amounts of time to manually tag every relevant skill/state/etc., but I could be wrong.

Is this something that can be reasonably accomplished with a plugin (and does such a plugin already exist?), or does RMMV's default battle system make that a pipe dream? I need the input of a veteran.
Is this something that can be reasonably accomplished with a plugin (and does such a plugin already exist?), or does RMMV's default battle system make that a pipe dream? I need the input of a veteran.
Yanfly's Buffs & States Core can adapt to this. Don't have states wear off at turn ends. Instead, use Custom Apply Effect to give it a number of 'uses', then use other effects to determine how the state works and them remove those uses, removing the state afterwards if uses is 0 (or less*). You could use "state counters" for this. I've done this for a 'block' state that stops all damage once per use and can stack, going away at the end of battle. The only thing I don't remember is how to replace gaining the state again with adding to the number.

*Because you never know if something weird might come up and drop the number of uses to 0 or below, this is a simple out so the state doesn't last forever.

EDIT: One possible way to 'stack' numbers onto a state is to have the state "apply" effect set the starting number to 0 if there isn't already a number in place and setting it to nothing with "remove" effect. This will make sure it has a counter at all. Then anything that adds the state should further use addStateCounter to increase the number the amount of times you want it to be increased. To use my 'block' idea above, this could let someone use Guard to stack one Block on themselves and Mighty Shell to stack three Block on any target. If actor 1 uses Block and actor 2 targets 1 with Mighty Shell, actor 1 will have Block 4 and each level will eat one attack until all are used up.

Original thread: https://forums.rpgmakerweb.com/threads/count-based-states-as-opposed-to-turn-based.152723/