How to increase a variable when enemy is weak to fire is defeated

Hey there,

I'm currently working on a project and could use some assistance with a specific mechanic. I'm using several Yanfly Engine plugins, and here's what I'm going to achieve:

I want to create a variable that increase by 1 if enemy is weak to fire defeated.

Could anyone help me on how I can implement this?

Thank you in advance!
Your title and your post are asking two different things - which do you want?

If you want the variable to increase when a certain enemy is defeated, the element rate has nothing to do with it because you've defined that rate in the enemy's database entry.

Or do you want the variable to increase when any enemy is defeated, only if their element rate for fire is 200%?
do you want the variable to increase when any enemy is defeated, only if their element rate for fire is 200%?
Oh sorry for that.

I want this.
Use Yanfly's Buffs & States Core and give your state 1 the notetag:
Code:
<Custom Apply Effect>
if (!user.isActor() && user.elementRate(69) >= 2)
    $gameVariables.setValue(42, $gameVariables.value(42) + 1);
</Custom Apply Effect>
where 69 is the ID of your fire element and 42 is the ID of the variable you want to add to.
Use Yanfly's Buffs & States Core and give your state 1 the notetag:
Code:
<Custom Apply Effect>
if (!user.isActor() && user.elementRate(69) >= 2)
    $gameVariables.setValue(42, $gameVariables.value(42) + 1);
</Custom Apply Effect>
where 69 is the ID of your fire element and 42 is the ID of the variable you want to add to.
Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/how-to-increase-a-variable-when-enemy-is-weak-to-fire-is-defeated.168801/