Add common event to game over core plugin

I want to add common event 56 after selecting retry battle command in SRDude game over core plugin. I tried this

_.retryBattle = function() {
if($gameTemp._setUpRetry) {
$gameTemp.reserveCommonEvent(56);
BattleManager.playBattleBgm();
BattleManager.setup($gameTemp._setUpRetry[0], $gameTemp._setUpRetry[1], $gameTemp._setUpRetry[2]);
$gameParty = JsonEx.makeDeepCopy($gameTemp._setUpRetry[3]);
$gameActors = JsonEx.makeDeepCopy($gameTemp._setUpRetry[4]);
$gamePlayer.makeEncounterCount();
SceneManager.goto(Scene_Battle);
}

But it doesnt do anything. Could someone help me with this problem,

Thanks
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.
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.
Otherwise you have to further on what does your common event do.
I can't tell what to do if it's oblivious to me, but it now sounds like you want it to run right after the battle begins, rather than before. If you share nothing else, the only thing I can tell you is to now try placing it below that line, but I kind of feel it will work in a weird way.

Original thread: https://forums.rpgmakerweb.com/threads/add-common-event-to-game-over-core-plugin.108033/