Making an enemy only able to use a skill if they're debuffed?

I have a weirdly specific issue. I've given some enemies a skill that lets them cancel all debuffs on themself, and some enemies have a skill that lets them cancel all buffs on the party. My issue is that these enemies will throw out these skills randomly, even if no one is buffed or debuffed. How would I make it so enemies will only use these skills when they'd do something (specifically, only remove debuffs when they're debuffed, or remove the party's buffs when they're buffed)? I could apply a hidden state when an enemy is debuffed that enables the ability to use the debuff remover, but that's only half of my problem, and it raises other problems if they cancel a debuff by getting buffed. Frankly it'd be a huge pain to implement.
I think you'll want something like Hime's Scope Conditions. Assuming that you're applying these buffs or debuffs as states you can set it up so they will only use them if their opponent is afflicted with a state. I used a similar setup not that long ago for an enemy skill I was creating, you can check my post history. I can't guarantee this is 100% applicable to your situation but it might help.
I think you'll want something like Hime's Scope Conditions. Assuming that you're applying these buffs or debuffs as states you can set it up so they will only use them if their opponent is afflicted with a state. I used a similar setup not that long ago for an enemy skill I was creating, you can check my post history. I can't guarantee this is 100% applicable to your situation but it might help.
I'm not using states for the buffs, I'm using the "add buff" thing in the skill effects box. I don't care if the skill hits everyone, I just want my bosses to quit wasting turns on the skill when it's not necessary.

Original thread: https://forums.rpgmakerweb.com/threads/making-an-enemy-only-able-to-use-a-skill-if-theyre-debuffed.129683/