Changing the party name should never have any effect on the battle end handling. The behaviour you state is the expected outcome: the "individual party members flee" sequence, basically Abort Battle. However, I don't know why you're only seeing that after adding my little override.
In case it's some kind of weird plugin conflict, here's a slightly different approach (see attached file):
Spoiler: full plugin code
JavaScript:
/*:
* @target MZ
* @plugindesc Improves battle result controls when using Escape on actors.
* @url https://forums.rpgmakerweb.com/index.php?threads/149507/
* @help Use one of these script calls to make the next escape a defeat:
* BattleManager._escapeType = 'defeat';
* BattleManager._escapeType = 'lose';
*
* Use one of these script calls to make the next escape a victory:
* BattleManager._escapeType = 'victory';
* BattleManager._escapeType = 'win';
*
* Note that this value will NOT be included in save data.
* Also, it will be reset at the end of the battle.
* It is designed to be used mid-battle to affect the outcome of that battle.
*
* This plugin also makes the party name include hidden/escaped members.
*
* Terms of use:
* Free to use and/or modify for any purpose, no credit required.
*/
// Change response when party members escape individually
;void (alias => {
BattleManager.processPartyEscape = function() {
switch (String(this._escapeType).toLowerCase()) {
case 'victory': case 'win':
this.processVictory();
break;
case 'defeat': case 'lose':
this.processDefeat();
break;
default:
alias.apply(this, arguments);
break;
}
};
})(BattleManager.processPartyEscape);
// Always reset value, for consistent load/save behaviour
void (alias => {
BattleManager.endBattle = function(result) {
alias.apply(this, arguments);
// reset escape type
delete this._escapeType;
};
})(BattleManager.endBattle);
// Make party name include escaped members (for win/lose msgs)
Game_Party.prototype.name = function() {
// replaced: battleMembers -> allBattleMembers
const members = this.allBattleMembers();
const numBattleMembers = members.length;
if (numBattleMembers === 0) {
return "";
} else if (numBattleMembers === 1) {
return members[0].name();
} else {
return TextManager.partyName.format(members[0].name());
}
};
Apart from (a slightly updated version of) the fix I mentioned earlier for the party name, this adds some script calls, namely:
BattleManager._escapeType = 'win'; and
BattleManager._escapeType = 'lose';
These convert an "individual party members escaped" result for the current battle into a standard victory or defeat result, respectively.
With this, you could change your skill's damage formula to:
b.addState(1); if ($gameParty.isAllDead()) BattleManager._escapeType = 'lose'; b.hide(); 0
I did some quick tests and this seems to work for me...but then so did my earlier suggestion.
😴
If you're still having problems, see if the problems disappear when you turn off your other plugins. If so, share screenshot(s) of your Plugin Manager and maybe someone will have some ideas as to what's going on.