Yanfly Class Change - Learning Previous Skills

I'm using the Yanfly Class Change plugin for VX Ace and nearly everything is perfect, however I would like for actors to automatically learn all the skills they would have learned up until that level if they change class. I'm not using independent job levels as I want the player to be able to switch up their tactics on the fly and don't want them to have to grind a job from Level 1 to 20 just to be at par with the rest of the party.

For example, say the character is currently in a Mage class and is level 5, and switches to the Knight class. They don't learn the Knight skills from levels 1-4 automatically. Is there anything I can add in the script to write the actor level to a variable, subtract 1, decrease the actor's level by the result and then increase it by the result again? I've done this method through event commands and it works fine, I just don't know enough about scripting and code to implement it into the script itself.

Any help would be very much appreciated, thanks!
actor.init_skills
that's the call for resetting all the skills.

should be called right after changing class.
You absolute legend, that worked perfectly. Been sitting here racking my brains trying to figure out how to code this and in the end it only needed one line, bloody typical. Cheers mate, and thanks for the super quick response. Guess we can close this, now!

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-class-change-learning-previous-skills.109036/