MZ Help with escaping battles

I'm using a plugin by Caethyril that takes away the party command in battle (Fight/Escape). I made a skill to escape with my party members, but it isn't working the way I want it. The problem is that when I use the skill and escape battle, the battle music continues outside of battle. I've tried everything in the skill setup and common events. I've also searched for plugins, but I can't get it to work.
show us your setup, as ending the battle should return to the map BGM.
if this isn't the case by your skill usage, it may how the plugin works.

either double check the plugin description, or ask the author of the plugin.
did you test it with only that plugin or do you use more plugins?
Answering this here~

I'm using a plugin that has a problem. The plugin skips the party command. The problem is, it takes away the escape option. I'm trying to make a skill that lets players escape, but can't get it to work. The best I can get is where the battle music continues after I escape.

Here is the plugin I'm using.

/*:
* @target MZ
* @plugindesc No party command (Fight, Escape) for TPB system.
* @Author Caethyril
* @url https://forums.rpgmakerweb.com/threads/176490/
* @Help Free to use and/or modify for any project, no credit required.
*/
// Patch - cycle actors, skipping party command.
void (alias => {
BattleManager.selectPreviousCommand = function() {
alias.apply(this, arguments);
if (this._inputting && !this.actor())
this.changeCurrentActor(true);
};
})(BattleManager.selectPreviousCommand);

// Patch - reset flag to false to block turn-0 party command.
void (alias => {
BattleManager.initMembers = function() {
alias.apply(this, arguments);
this._tpbNeedsPartyCommand = false;
};
})(BattleManager.initMembers);

// Override - in TPB-Wait mode, allow multiple actors to be charged at once.
Game_Actor.prototype.shouldDelayTpbCharge = function() { return false; };

As for other plugins that might conflict with the plugin, I have a good number of them that I'm using. I did try to run your plugin alone to see if I had the same problem, and a different problem came up. After the last party member left, it froze and only showed the character's face at the bottom.
(In future, please use the </> code formatting button when posting code! Otherwise the forum is prone to auto-formatting it and malforming/breaking it.)

Here's a link to the post where I shared this code:

Maybe I'm missing something, but I just tested again and it seems to work OK for me. I tried playing a BGM on the map, entering battle via Battle Processing, then making everyone run away using a skill with an Escape effect on it. The battle ended as expected and the map BGM was reinstated. This test was successful with core script versions 1.9.0 and 1.10.0.

This makes sense to me, because by default my code only impacts things affecting player input. So I suspect it's conflicting with either another plugin or a core script edit, or there's something else you're doing (e.g. an unusual script call, a Parallel event that plays BGM, etc) that you haven't mentioned. Ideas:
  1. With all plugins turned off in the Plugin Manager, save your project to apply Plugin Manager changes before testing. Otherwise the changes will not be respected, because the editor does not maintain a temporary "test" version of plugins.js.

  2. From the editor's menu bar, choose Game -> Update Corescript. Pick a version and click OK. This should ensure your project is running on a clean (i.e. no edits) version of the core scripts.

  3. As can be seen in the linked thread, this plugin of mine was specifically written for MZ's TPB system. If you've changed which battle system you're using, via the editor and/or plugins, you may well need a different plugin.
Otherwise, consider providing precise instructions on how to reproduce the problem, starting with "create a new project". 👋

Original thread: https://forums.rpgmakerweb.com/threads/help-with-escaping-battles.182886/