If you don't mind this effect to happen for EVERY fight where an enemy can escape, then turn this into a plugin and just play with its location in the plugin list to see where it works. (I say this because you did mention using Visustella plugins, so they might modify some of the code or alias it somewhere)
Code:
Game_Troop.prototype.expTotal = function() {
return this.members().reduce((r, enemy) => r + enemy.exp(), 0)
}
Game_Troop.prototype.goldTotal = function() {
return this.members().reduce((r, enemy) => r + enemy.gold(), 0) * this.goldRate()
}
Game_Troop.prototype.makeDropItems = function() {
return this.members().reduce((r, enemy) => r.concat(enemy.makeDropItems()), [])
}
This makes the game only look at ALL TROOP MEMBERS, not dead, not hiding, ect and it does work if all members escape or were killed.
Edit: Also, this works in a clean battle, no need to set funky flags using script or anything, if you make an enemy use escape it plays the escape animation/sound effects as it should, and the enemy death collapse works as normal as well.
Edit #2: Decided to make a slight alteration if you want to make it so only certain battles work that way by adding in a switch check. Edit the code as you need if you decide to use this version instead.
Code:
Game_Troop.prototype.expTotal = function() {
if ($gameSwitches.value(1) === true) { // Change Switch ID
return this.members().reduce((r, enemy) => r + enemy.exp(), 0)
}
else { // Original Code
return this.deadMembers().reduce((r, enemy) => r + enemy.exp(), 0)
}
}
Game_Troop.prototype.goldTotal = function() {
if ($gameSwitches.value(1) === true) { // Change Switch ID
return this.members().reduce((r, enemy) => r + enemy.gold(), 0) * this.goldRate()
}
else { // Original Code
const members = this.deadMembers();
return members.reduce((r, enemy) => r + enemy.gold(), 0) * this.goldRate();
}
}
Game_Troop.prototype.makeDropItems = function() {
if ($gameSwitches.value(1) === true) { // Change Switch ID
return this.members().reduce((r, enemy) => r.concat(enemy.makeDropItems()), [])
}
else { // Original Code
const members = this.deadMembers();
return members.reduce((r, enemy) => r.concat(enemy.makeDropItems()), []);
}
}