Auto battle problem: inflict states on skill evaluation

Hello,

I'm using states in my skill damage formulas (like "a.add_state(x);damage"), and it works fine except with auto battle. Apparently, when the game evaluates the different skills for auto battle, it applies the states that are included in the damage formula although the evaluation is done on a .clone and not on the actual battler object.

I had a similar problem with MP gain before ("a.mp+=x;damage" type formula) and adding .clone to "target.make_damage_value(subject.clone, item)" in Game_Action, "evaluate_item_with_target(target)" solved it. However, in-formula states are still inflicted upon skill evaluation. Is there a way to solve this?

Thank you.

EDIT - SOLVED

Alright, I just found a solution but I won't delete the post because someone else may want to know.

When using Yanfly's Battle Engine, simply add "unless $game_temp.evaluating" after "game_battler_add_new_state_abe(state_id)" in Alias method: add_new_state (Game_Battler). I'm not sure the problem exists if this script isn't used in the first place, but if I remove it to make sure the game will just crash.

Original thread: https://forums.rpgmakerweb.com/threads/auto-battle-problem-inflict-states-on-skill-evaluation.21980/