if !batonpass
# These effects are retained if Baton Pass is used
[B] @stages[PBStats::ATTACK] = 0
@stages[PBStats::DEFENSE] = 0
@stages[PBStats::SPEED] = 0
@stages[PBStats::SPATK] = 0
@stages[PBStats::SPDEF] = 0
@stages[PBStats::EVASION] = 0
@stages[PBStats::ACCURACY] = 0[/B]
@lastMoveUsedSketch = -1
@effects[PBEffects::AquaRing] = false
I think I know how to do that, but I didn't test this out. If you search for 'if !batonpass', which is under 'def pbInitEffects(batonpass)' in the Pokebattle_Battler script, delete the lines of code below that are bolded:
Code:if !batonpass # These effects are retained if Baton Pass is used [B] @stages[PBStats::ATTACK] = 0 @stages[PBStats::DEFENSE] = 0 @stages[PBStats::SPEED] = 0 @stages[PBStats::SPATK] = 0 @stages[PBStats::SPDEF] = 0 @stages[PBStats::EVASION] = 0 @stages[PBStats::ACCURACY] = 0[/B] @lastMoveUsedSketch = -1 @effects[PBEffects::AquaRing] = false
Just to confirm, because I'm stupid. You want me to delete this part.
Actually, now that I'm thinking about it, you probably should move (cut and paste) the part in bold to another part. If you scroll up a little from the section of code I showed, you'll see 'def pbInitPermanentEffects'. Underneath that, you will find this line of code: '@effects[PBEffects::WishMaker] = -1'. Move the code in bold from above to below that line and make sure you delete it under 'if !batonpass'.
It really didn't work. There's no facility for a Pokémon to remember any applied battle effect when it's switched out, so using any existing code will not make it do so.
Those permanent effects apply to whichever Pokémon replaced the one you switched out (and more generally, any Pokémon in that position on the battlefield), so the Pokémon you switched out isn't remembering anything; the replacement Pokémon is just inheriting its stat stages even without the magic of Baton Pass.