Call Common Event At Fight End [Resolved]

I'd like to call a Common Event when the fight ends in victory: preferably, when the battle screen has actually cleared and you're back on the map. The Common Event will do a number of things in different circumstances but mostly, it will restore the whole party and reset numerous variables used with fights.

I tried to do this myself, in my infantile-to-nonexistent scripting abilities, by going to Scene_Battle1, Battle Ends, and around line 150 or so right below Scene.Map.new, placing: "$game_temp.common_event_id = [50]"

This causes my game to give the following error after fights:

Script 'Interpreter 1' line 72: NoMethodError occurred.
undefined method '>' for [50]:Array

I tried using a neat script I found at http://rmrk.net/index.php?topic=41716.0 -- but it's for RMVX, and it causes an error when I start the game related to class Scene_Base.

I will accept pretty much any solution, a keenly directed "Here's where you can put it in yourself", "Here's how to make what you're already doing not crash", or a script that does this, a link to a script that does this already, or whatever. Thanks for the assistance.
I'm not completely sure how common events are called, but for starters, you could get rid of the [] around "50" in your call (the script expects an integer, but you're feeding it an array instead).

If that doesn't work, I'll try looking into the scripts themselves to see how they work.
Well... instead of making things SUPER complex... why not:

Make your common Event like -

(Common Event : Activates if [Switch] Fight: ON : Auto-Run)

- During the begining of a battle [Switch] Fight is turned ON

- Since that is ON, after the fight is OVER... Common Event Innitiates
and does what you want it to do... and at the END of the Common Event.

- [Switch] Fight = OFF
Both of those work, actually. I'm one to try and use as few scripts as possible but since I had the script line already there, I just took off the brackets and now it does what I want it to. I'll keep the switching method in mind for the future. Thanks.

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=76806