MV Preserving buffs/debuffs outside of combat (RESOLVED)

Running MV 1.6.3.

Hi!
I haven't been able to find anyone asking this question, so I decided I'd see for myself.
As I'm sure we already know, buffs/debuffs are removed from actors after a battle ends.
Is it possible to make it so that they stay applied to an actor after a battle? I know this is achievable through states, and if I have to I'll just set it up like that, but I figured that it was worth at least asking if this is possible at all.

(I mainly wanted to ask this so I don't have to completely rework buffs for my game)
They're removed at battle end, I think you can just comment it out (copy paste to notepad and save as .js file in your plugin folder and add in plugin manager).
However if you kill the last enemy, I don't think the buff turns decrease for that turn, so if you want that to happen, you'd have to add some code. Like in the below method to decrease all buff turns by 1.

Game_Battler.prototype.onBattleEnd = function() {
this.clearResult();
this.removeBattleStates();
// this.removeAllBuffs();
this.clearActions();
if (!this.isPreserveTp()) {
this.clearTp();
}
this.appear();
};
This works nicely, tested it in-game with no issues! Thank you very much!
Just a reminder that, by default, all states (and buffs) will advance one turn every 20 steps while on the map.

Not sure if that is an issue here, but you could increase the step threshold like this (will also delay poison effects on the map):
JavaScript:
Game_Actor.prototype.stepsForTurn = function() {
    return Infinity;
};

Original thread: https://forums.rpgmakerweb.com/threads/preserving-buffs-debuffs-outside-of-combat-resolved.180928/