Yanfly Battlecore & States Buffs [Changing Classes]

Hey lads. I'm using quite a few of Yanfly's scripts and I particularly enjoy the transformations that are possible with them.
My question is - When a state is added, is it possible to change the users class and revert when the state is no longer there?


EDIT: Scripts for reference.

Yanfly's Battle Engine Core
https://www.dropbox.com/s/4mgcqz5hgnblwez/YEP_BattleEngineCore.js?dl=0

Yanfly's Buffs States Core
https://www.dropbox.com/s/0fk64r7zwfx90fo/YEP_BuffsStatesCore.js?dl=0
<Custom Apply Effect>
user._classIdRemember = user._classIdRemember || user.currentClass().id;
user.changeClass(x, true);
</Custom Apply Effect>
<Custom Remove Effect>
user._classIdRemember = user._classIdRemember || user.currentClass().id;
user.changeClass(user._classIdRemember, true);
</Custom Remove Effect>

Where x is the class you want to change it to.
Hey, nice, thank you very much, that works perfectly

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-battlecore-states-buffs-changing-classes.93024/