MV Counterattacking based on state-specific conditions

As title says.

What I am looking for: While a battler is affected by state X, they will launch a counterattack against an enemy with state Y. This is different from a regular counterattack in that it is unaffected by the CNT parameter, and will always work as long as the enemy dealt damage to them. The fantasy is that the battler with state X has 'challenged their enemy' (applying state Y as a result), and will respond with a counterattack if the enemy 'accepted the challenge' (attacked the battler with state X).

TIA

Original thread: https://forums.rpgmakerweb.com/threads/counterattacking-based-on-state-specific-conditions.143872/