Skills require enemy (or player) to be in a certain state to use?

I'm pretty sure this must already exist as a plugin (presumably Yanfly) since I know I had one that worked with VXA, but could someone please point me towards the best way to do this?

Basically, what I need is:
Player can only use skill X on an enemy when that enemy is already suffering from state Y.

Plugins to Yanfly's combat core would be best, but happy to use something else if that's a better option.
Try Yanfly's Selection Control (requires Target Core and Battle Engine Core). Links:
It offers a skill notetag to narrow down the set of valid targets, e.g.
Code:
<Select Conditions>
State: 6
</Select Conditions>

Original thread: https://forums.rpgmakerweb.com/threads/skills-require-enemy-or-player-to-be-in-a-certain-state-to-use.108997/