Cycling through the same part of the game

Hi there.
I have started a game where the MC wakes up in an abandoned wrecked House.
When he goes around in the world there will be an event which will take him
back to this house but now it looks as newly build.
There he will encounter a boss and after he defeats it it'll shake and then getting black.

After that I want to completely restart, his level and skills will go back like the game had
just started. Only some specific items will stay on him. Everything else (except his weapon)
will vanish.

First is this possible? Would I have to take everything by hand like skills (or do they go back just by
setting the level to 1?) and Items?
Or is there a way to wipe the inventory except for key items?

The next part is a bit trickier I think.
After everyhing goes black there will be some text which should be different for each time.
Like some hints to escape this loop.
And when the MC defeats this boss a fourth time another text should appear and after that comes
a gameover screen. And if the player didn't collect all key items by that time he would be forced
to start a new game (because leaving the house when its not a ruin is not possible)
Or how could I do it that saving is impossible in the fourth cycle?
there is no problem handling any of these ideas.

1) story progression is often counted by a variable that is counted up by special events and then triggers other events on certain numbers. that is what the event condition is for after all.
2) any actor can be reset on adding to the part by the checkbox to initialise. just remove him once and add again with that checkbox clicked.
3) inventory need to be handled manually, especially if you want to exempt certain items from that - there is a script command for a quick clear but that will remove everything.
4) there is an event command to enable and disable save access
Can I just use any of the variables and increase them and it would stay until I change them? Or would quitting the game reset these variables?
So for the Inventory it would be the easiest way to wipe it with the script command and before that check which key items were gathered and add these after the wipe.

What are these script commands?
Though I'm working as a developer I'm mostly working with C# and not in any kind of scripting so that's not so known to me.
C# can't be used, the engine works in Javascript.

for your other questions I strongly suggest you work throug the build-in tutorial to get the basics of eventing, but saving stores the variables of the current game and those are only reset on new game, although some of your plugins may be configured to use some of the variables.
Okay I got it working.
Thanks for your help.

Original thread: https://forums.rpgmakerweb.com/threads/cycling-through-the-same-part-of-the-game.143198/