How do I allow players senario freedom in the vein of the Mega Man Games?

Greetings. I am wondering what I should do to allow players to select which senario in the story will be first, second, third, and so on until all senarios are defeated in which the final senario opens up and the players fight through the endgame while still allowing players to go back to the previous zones in case they missed something.

I am also going to have an auto balance system where all enemies gradually gets stronger as the players fight through the senarios. I am also thinking about having the players learn various spells from the bosses that have been defeated. So... How do I pull it off? I'm sorry if this is too much to ask for.
I'd probably turn on a switch when each scenario is defeated (so as to close it off, use a conditional check to see if it is on or off before allowing the selection), and when each scenario is defeated add one to a variable. Once the variable is at your desired level, open up the last and final scenario.

Does require a lot of checks against switches and variables. If you aren't comfortable with either (or both), may want to become comfortable with both of them before attempting this.

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-allow-players-senario-freedom-in-the-vein-of-the-mega-man-games.52963/