MV Counter when inflicted with a state? (Yanfly Counter Core)

How do you have a counter condition notetag that has you only counter when inflicted with a certain state? I looked through the plugin I'm currently using, Yanfly Counter Core, and I can't find a notetag in the counter condition section that would make it so that you can only counter when a battler is inflicted with a certain state. Any help would be appriciated. Thanks.
Bump
Plugin link:

Maybe just put the Counter Rate trait on the state? Depends what you want, mechanically.

Otherwise you could try this on your counter skill:
Code:
<Custom Counter Condition>
condition = defender.isStateAffected(123);
</Custom Counter Condition>
I.e. "only proc if the target is affected by state ID 123" (replace as needed).
actually, you do not need a plugin for this. Just force all classes to have 0 counter rate, then have a state that adds counter rate. The Ex-Param you need to manipulate is the "Counter Attack" param.
@caethyril I already have that plugin, so the code you gave me should work wonders. That was exactly what I was looking for. Thanks!

@zelanius Sorry, but that doesn't really help. For the plugin I'm using to work (YEP Counter Core) all passive skills that give you counters must also give you 100% Counter Chance or counters won't trigger. The plugin only replaces the default counter, (attack) not giving you an entirely different counter. The passive state itself is only supposed to trigger if certain states are afflicted on either the user or the target, so yeah.
@KrimsonKatt you are using RPG Maker MV, right? If yes, like I said, you don't need a plugin to make it such that only when a character has a state then they will counter. You can use the "Traits" section in the actor/classes/states to manipulate when you want the counter to happen. So, if you don't want your characters to counter normally, then just make their Ex-Param for Counter Attack 0 under Actor or Classes, then add the Ex-Param back through a State.

I am assuming you mean YEP Counter Control as the plugin you are using (YEP don't have a Counter Core for RMMV)? If yes, then what this plugin does is simply allow you to primarily change the skill you counter with, and whether you will dodge the attack or not before countering. In addition, you can use States to apply the counter skill to use.

So, if you are trying to set it such that you can apply a state to a battler and they will then counter attack:
1. Make the actor or class have 0% Counter Attack
2. Have someway to apply the state (like in a buffing skill) where they are able to Counter 100%

If you are taking it further to have the State also determine what kind of counter skill, you will need the plugin and:
3. use the following <Counter Skills: x> notetag in the States notebox, replacing x with the Skill ID that you want to counter with

If you use step 1 and 2 above, then the classes by default will never counter unless they have the state applied. If you go further with step 3, you can use different skills to apply different states, so that the character can counter with different skills.

Admittedly, caethyril's method is far more efficient. My alternative is simply more for people who are not well-versed in JS (like myself).

Hope this clarifies.
@zelanius Thanks for the help, but sorry I don't really need it anymore as someone helped me out in another thread find what I was looking for. Here is the code I'm using the future referance.

Code:
<Custom Counter Condition>
value = user.isStateAffected(x); {
condition = true;
} else {
condition = false;
}
</Custom Counter Condition>

Closing the thread now.
yaa, really dont need the plugin for that alone. not if its only a normal attack for the counter attack
and the plugin doesn't default you to 100% counter rate. it just allows different skills (in addition to normal attack counter) and have different counter% rates and conditions for each skill.

default engine only counters when target has a counter rate and is attacked by skills that have physical attack type. and the only counter attack option is skill ID 1 normal attack.
and pretty sure the default is evade and counter attack? which is overpowered

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/counter-when-inflicted-with-a-state-yanfly-counter-core.130873/