MV Counter only specific element (YEP Counter Control)

Heyho!
Using Yanflys Counter Control I try to create a state that trigger a counter skill in 100% of the cases as long as the wielder is attacked using a certain element, say fire.
Here's the problem:

I have an actor with a default counter rate of 5% and a default counter skill.
Now I inflict the state on the actor: It raises the counter rate to 100% and adds another counter skill, with the element fire as a condition. But since conditions can only be added to counter skills, not to the related state (correct me if I am wrong here), the counter rate will still be 100%, even if the actor is hit with another element. So the default counter skill will still trigger in 100% of the cases.

I don't see any built in way to avoid that with just the Counter Control Plugin, but if anybody has a suggestions I'd be very happy to try it.

What I thought of instead however was using Yanflys Buffs and State Core Plugin.
It should be possible to give the state a Custom Select condition, which raises the counter rate to 100%, if the wielder is selected as the target of a fire skill and puts it backs to it's previos value afterwards. But I don't know how to do that exactly. The only thing I have so far ist this:

Code:
<Custom Select Effect>
var fire = 3
var elements = this.getItemElements();
if (elements.some(function(e) {
  return e === fire;
})) {

//Store the current counter rate
//Set it to 100%

}
</Custom Select Effect>

<Custom Conclude Effect>
 
//Set the counter rate to the stored value

</Custom Conclude Effect>

Do you think I am on the rate track? If so, how do I achieve what I want? If not, is there an easier way to achieve this?

Thanks in advance~
So the default counter skill will still trigger in 100% of the cases
the order that the plugin considers the counters is the order of the states by their priority, then by their ID. so if you wanted a counter to have first dibs at being evaluated, youd be able to do that by making the state that grants it have a higher priority than the others.
Ah sorry, maybe I was unclear about this. The problem is not that the false counter skill is triggered, but that both share the same counter rate of 100%.

So all non fire attacks will result in the default counter, because I raised the rate.
But I only want fire attacks to be countered with a 100% rate. If the attack is non fire the rate should stay at 5%.
then you can give the actor a 100% counter rate in general and then use the <Custom Counter Rate> notetag on your basic counter to make it only trigger 5% of the time
Wait - I thought the Counter Rate Notetag on a skill alters the Counter Rate of this skills target.
For example a Skill with 5% Counter Rate, has 5% chance to be countered by the target it hits? At least this is how I read the explanation. I could be wrong though.
If it works like you said, then it's indeed a nice solution 😀
oh, youre right. i misremembered the tag. its the <Custom Counter Condition> notetag and a Math.random() call that you can use to do it.

Original thread: https://forums.rpgmakerweb.com/threads/counter-only-specific-element-yep-counter-control.176306/