MZ Yanfly Battlecore & States Buffs [Changing Classes] In Rpg Maker MZ.

Sorry for the inconvenience. I have a question about a Rpg Maker MV plugin called Yanfly Buff and State Core. It turns out that I want to change the class of a character when it is under a state but that it returns to normal when it disappears. The issue is that it works in MV but not in MZ (at least the part where the state is removed since it works when applied). PS: I asked Chat GPT and he answered me that the formulas work a little different in MZ and that's why it doesn't change. Thank you very much in advance and have a nice weekend.

<Custom Apply Effect>

user._classIdRemember = user._classIdRemember || user.currentClass().id;

user.changeClass(2, true);

</Custom Apply Effect>

<Custom Remove Effect>

user._classIdRemember = user._classIdRemember || user.currentClass().id;

user.changeClass(user._classIdRemember, true);

</Custom Remove Effect>
It isn't just the formulas which work differently.

If you are using MZ, then you will need to use the MZ plugin. It is part of the free basic collection of VS plugins (equivalent to YEP plugins for MV). You will need to replace any other core plugins for MZ ones if you haven't already done so.

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-battlecore-states-buffs-changing-classes-in-rpg-maker-mz.173571/