Let game restart after defeated

In the default game system, the game will go back to title after being defeated in a battle.
In order to avoid some plugins compatible issue, I decide to let the game restart instead of going back to title
because I realize there's no any errors if I restart the game(press F5)after defeated.
How can I let the game restart same as F5 being pressed when defeated?
You have a problem with Title skip plugins, don't you? I'd recommend using HIME's plugin if that is the case, because that one covers off the issue many forgot about.
Because what you're demanding is not the easiest to make due to the scope of the three functions.
You'd have to delete how the game processes F5 by default, then you'd have to program to BattleManager that if f5 is being pressed upon Process defeat function, this happens.
DataManager.setupNewGame();
SceneManager.goto(Scene_Map);
First: If Poryg is right with your usage of title skip plugins I agree that you should change your plugin to HIMEs.

Changing the GameOver to F5-Behavior is simple. Just create a file GameOverAlter.js in your plugins folder, edit it with notepad and paste and save this:

Scene_Gameover.prototype.gotoTitle = function() {
location.reload();
};

Then just add the plugin in the plugins window and activate it. However I recommend to find another solution, because this function will not work on every platform.

Original thread: https://forums.rpgmakerweb.com/threads/let-game-restart-after-defeated.88061/