Actor changing class at a certain level

Sorry if this has been asked before, however I could not find guide on how to do this. Basically I have my main character start out as a simple warrior, but once they reach a certain level, ie 5, they change to a different class that includes some magic skills. This new class will include the Hex skill type, so I am creating a different class for that, however I cannot figure out how to run a variable that constantly checks what level the character is and assigned the correct class based on that level. I do not want the player to revert back, as this new class is story line driven. I also don't want to use plugins as many tend to clash with one another from different developers. I thought about using common events, however I still couldn't figure it out. I appreciate any help provided, and I apologize if this has been asked before. I also apologize if I have posted this in the wrong forum.

I've moved this thread to MV Support. Thank you.

My apologies. Thank for the update.
Very simple https://prnt.sc/t2bv6y
You need to create a variable with game data, actor, lvl.
And the If statement will check if the actor is lvl 5 or more.
You can put another in else like IF its = > lvl 10.
And for the skill you need to create a new skill for that especific class and give it to the actor.
You can even do for him to forget skills

EDIT: Oooops, I putted to him be a warrior, you can change to whatever you want.
Very simple https://prnt.sc/t2bv6y
You need to create a variable with game data, actor, lvl.
And the If statement will check if the actor is lvl 5 or more.
You can put another in else like IF its = > lvl 10.
And for the skill you need to create a new skill for that especific class and give it to the actor.
You can even do for him to forget skills

EDIT: Oooops, I putted to him be a warrior, you can change to whatever you want.
Awesome thank you. I am going to test this out.
Ok I tried it out, but I think I am still missing something. I know that I need to turn on the "LVL" switch for this common event to run, however I am not sure what would be the best way to do it. I tried calling another common event to turn it on, how all it did was slow my game down significantly. I also tried adding a parallel event on the map that turned the switch on, but I got nothing except for the decrease in speed.
It puts slow, because of the loop.
Your pc seems to be not that good for that.
If you erase the loop I dont have sure if the code will work properly...
If you want to delete the loop you need to put the event in every map as parallel swith.

Or you can leave the loop but put some "waits" to reduce the CPU usage.
Thank you MightyEgg, I was able to get it to work by removing the loop and just adding a parallel switch on every map. Thankfully I don't too many yet, and can just copy and paste it. I have been seeing places where to set up a variable to store the EXP, which I have that, but I cannot seem to figure out add to add it to the Actor. This is what I thought I needed,
1592582434800.png
You are saying when you give class to the actor it restart the lvl?
You can Edit the orage code and tick the save lvl, it will appear an "true".
ok must have missed that. I will take a look. Really appreciate all your help
Ok so I had to do a work around since I did not have the option to tick the save level true.
1592604968273.png

I had to add the Change Level and change the constant to +4 which would bring the Actor to Level 5 in the new class. I also had to run the variable again and set it to a variable of 0. This keeps it from constantly running and adding levels. Again thank you MightyEgg for all the help.
Np, but you dont have this option? https://prnt.sc/t38bnb
Nope I do not, just the option to choose Actor and Class

Original thread: https://forums.rpgmakerweb.com/threads/actor-changing-class-at-a-certain-level.123041/