That code isn't in the original plugin, so I take it you modified it. The lines below your modification say "Set the conditions before the fight", "Reset the party", "Reset the actors to their battle start state", "update the counter count", and only then, start the battle again.
If your common event does anything to alter the actors, it will be wiped on a few lines.
If it's the case, place your modified line right before SceneManager.goto(Scene_Battle); .
Otherwise you have to further on what does your common event do.
Thank you for the reply. I put the event before the scenemanager goto but nothing happens. The event is supposed to open the menu scene before battle when I click on retry battle.