MV Bonus EXP reward after battle victory.

In my game, I want my enemies to show a sense of self-preservation and intelligence, so I made it so most enemies will attempt to escape battle while on low health. The problem is that since EXP and Item Drops are linked to how many enemies you *KILL* you can enter a battle, get knocked down to critical health and be forced to use a bunch of healing items, and then get absolutely no reward.
Although I kinda like this, as it makes combat very risky and forces you to balance keeping yourself alive and killing enemies as fast as you can, I don't think it's fair (or realistic) for players to lose out on EXP for something that is mostly out of their control.

I want it so that the EXP that the party gains is determined by the Troop they've fought instead of Enemies killed, it would also be nice if Troops influenced Gold and Item Drops (e.g. you could make a Troop a caravan you could raid for a bunch of resources) but EXP is the main one.
In my game, I want my enemies to show a sense of self-preservation and intelligence, so I made it so most enemies will attempt to escape battle while on low health. The problem is that since EXP and Item Drops are linked to how many enemies you *KILL* you can enter a battle, get knocked down to critical health and be forced to use a bunch of healing items, and then get absolutely no reward.
Although I kinda like this, as it makes combat very risky and forces you to balance keeping yourself alive and killing enemies as fast as you can, I don't think it's fair (or realistic) for players to lose out on EXP for something that is mostly out of their control.

I want it so that the EXP that the party gains is determined by the Troop they've fought instead of Enemies killed, it would also be nice if Troops influenced Gold and Item Drops (e.g. you could make a Troop a caravan you could raid for a bunch of resources) but EXP is the main one.
Make EXP and Gold on all enemies 0 and then add an event for each Troop that starts at the beginning of the battle and pays out whatever Exp and Gold you want. That way as long as they survive the fight, they get it. The only issue I see is them leveling up before the fight starts with this, but you could also add it so when all enemies hit 0 HP it pays out, but it takes a bit of Conditional Branching each Troops to what enemies there are.
You can also just modify some of the methods. The BattleManager.makeRewards gives you exp based on this._rewards.exp = $gameTroop.expTotal();

You can modify that method to give exp based on not dead enemies, but instead how much damage you've dealt to the enemies:

Game_Troop.prototype.expTotal = function() {
return this.members().reduce(function(r, enemy) {
return r + (1 - enemy.hpRate())*enemy.exp();
}, 0);
};
Sorry for taking so long to respond.

Game_Troop.prototype.expTotal = function() {
return this.members().reduce(function(r, enemy) {
return r + (1 - enemy.hpRate())*enemy.exp();
}, 0);
};
After putting this in a plugin and adding a Math.round() to prevent weird non-integers this works perfect! Thank you so much!

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/bonus-exp-reward-after-battle-victory.181113/