Hit rate equal to the variable

Hello, I wanted variable 13 to always be equal to the hit rate of my actor number 4, I wanted that when I lowered the value of variable 13, it would also lower the hit rate of my actor, I am using this with passives like "Custom Passive Condition Variable 13 Below 80", could you help me?



1758634643710.png
Are you using Yanfly's Passive States? You can check the owner's HIT directly in the state instead of storing it in a variable by giving it the state with <Custom Passive Condition> like this:

Code:
<Custom Passive Condition>
if (user.hit < 0.8){ // Below 80%
condition = true;} //activate the state
else{
condition = false;} //deactivate the state
</Custom Passive Condition>

Also, you cannot lower your actor's hit by using ".hit = X". It only returns a value, and is not used to set a value. Unless you are also using Yanfly's Extra Param Formula plugin.

Try to make use of Lunatic Mode. It allows you to have better control over the passive states.
Are you using Yanfly's Passive States? You can check the owner's HIT directly in the state instead of storing it in a variable by giving it the state with <Custom Passive Condition> like this:

Code:
<Custom Passive Condition>
if (user.hit < 0.8){ // Below 80%
condition = true;} //activate the state
else{
condition = false;} //deactivate the state
</Custom Passive Condition>

Also, you cannot lower your actor's hit by using ".hit = X". It only returns a value, and is not used to set a value. Unless you are also using Yanfly's Extra Param Formula plugin.

Try to make use of Lunatic Mode. It allows you to have better control over the passive states.
It worked very well thank you, I tried it by variable, because I have another passive that every time I miss an attack it increases this variable by 5, thus increasing the hit rate by 5, so can I use user.hit to increase it by 5 points?, stacking?
You cannot set an actor's HIT that way. To modify it using a dynamic value, you might need plugins like Yanfly's Extra Param Formula.

Original thread: https://forums.rpgmakerweb.com/threads/hit-rate-equal-to-the-variable.180250/