Can someone help me figure out a script call? (VX custom script)

Hello. I feel this is the right section to post this in, so here's my problem:

I commissioned a script a little while ago, because I need the field music to persist playing when a battle starts, and when it ends. Think of how Aeris' theme keeps on playing before, during and after the battle with the boss Jenova Life at the Ancient Capital in FF7, or this:



I'm 120% sure it was working fine in a prior build of the game that I didn't save, and I foolishly lost the note where I wrote the script call. As a result, I'm having the problem of the music restarting at the end of the battle. Turning off the victory theme has no effect; I've also tried changing the battle BGM to match the theme, to no effect. Again, I'm sure it was all handled via a script call, and I'm not sure if I can get a hold of the scripter who made them, as he's busy with university life. Here are the scripts:

Part one (it's entered as two separate scripts):
Code:
class Game_Temp
  attr_accessor :equus_dont_stop_bgm
end

Part two:
Code:
class Scene_Map < Scene_Base
  def call_battle
    @spriteset.update
    Graphics.update
    $game_player.make_encounter_count
    $game_player.straighten
    $game_temp.map_bgm = RPG::BGM.last
    $game_temp.map_bgs = RPG::BGS.last
    unless $game_temp.equus_dont_stop_bgm
      RPG::BGM.stop
      RPG::BGS.stop
    end
    Sound.play_battle_start
    $game_system.battle_bgm.play unless $game_temp.equus_dont_stop_bgm
    $game_temp.next_scene = nil
    $scene = Scene_Battle.new
  end
end

Using the script call "$game_temp.equus_dont_stop_bgm=true" produces the results described above, so I think there must be something else that needs to be entered. If someone can please help me figure out the rest of the call (if any), let me know, and thanks in advance. Further info available if needed.

Short version: I need this script to keep on playing the field music as a battle starts, and not restart it at the end of the battle.

Thanks.
$game_temp doesn't get saved when you save the game. So when you call the script to change it to true, if you load the game, it will be back to nil, which is "false". Maybe you want to change it to Game_System instead.

Code:
class Game_System
  attr_accessor :equus_dont_stop_bgm
end

class Scene_Map < Scene_Base
  def call_battle
   @spriteset.update
   Graphics.update
   $game_player.make_encounter_count
   $game_player.straighten
   $game_temp.map_bgm = RPG::BGM.last
   $game_temp.map_bgs = RPG::BGS.last
   unless $game_system.equus_dont_stop_bgm
     RPG::BGM.stop
     RPG::BGS.stop
   end
   Sound.play_battle_start
   $game_system.battle_bgm.play unless $game_system.equus_dont_stop_bgm
   $game_temp.next_scene = nil
   $scene = Scene_Battle.new
  end
end
Agree with the above.

And the script call to turn it on would be:
Code:
$game_system.equus_dont_stop_bgm = true

and the script call to turn it off would be:
Code:
$game_system.equus_dont_stop_bgm = false
Going to try it later today. Though, the problem happened even after the event that calls the script does it right before execution. If this doesn't fix it, I'll have to make a request on the Classifieds. Thanks for both your input, will report later.
Welp, that didn't work. I get these errors when trying the suggested solution, on a freshly started game. (Not loading a test save)

Error1.jpg


Error2.jpg

Could there be a script call not to restart the track after the battle ends? That's the problem I'm having, and I remember it was working fine before. Thanks to anyone who looked at this, regardless.

Original thread: https://forums.rpgmakerweb.com/threads/can-someone-help-me-figure-out-a-script-call-vx-custom-script.107232/