I need help to modify a small script

Hi! Im new here and i seek somone that could help me modify this small script so that it would work only in battle ( and not just in debug in real game too ) and that it would need a certain accessory to work 🙂 thank you in advance!

Ruby:
=begin
 
 Speed Up Frame Rate During Test Play (Snippet)
 by PK8
 Created: 6/15/12
 Modified: -
 ──────────────────────────────────────────────────────────────────────────────
 ■ Author's Notes
   I made it mainly so I can wade through an unskippable cutscene for a project
   I was testing out.
 ──────────────────────────────────────────────────────────────────────────────
 ■ Introduction
   This script lets you speed up the frame rate of your project either
   automatically or with the touch of a button during test play. Useful if you
   really want to speed up battles, unskippable cutscenes, or whatever else you
   want to fast forward through during test play.
 ──────────────────────────────────────────────────────────────────────────────
 ■ Features
   o Speed up the frame rate of your game via button press or automatically
     while testplaying.
   o Set the value of the new frame rate. Can be absolute or relative.
 ──────────────────────────────────────────────────────────────────────────────
 ■ Changelog (MM/DD/YYYY)
   o v1    (06/15/2012): Initial Release
 ──────────────────────────────────────────────────────────────────────────────
 ■ Methods Aliased
   Graphics.update
 ──────────────────────────────────────────────────────────────────────────────
 ■ Thanks
   EJlol and Kore for watching me script it during a stream.

=end

#==============================================================================
# ** CONFIGURATION
#==============================================================================

module PK8
  class Framerate_Speedup
    #--------------------------------------------------------------------------
    # * General Settings
    #--------------------------------------------------------------------------
    
    Switch   = true    # Set true to enable. Set false to disable.
 
    Relative = false     # Set true to raise FPS relative to the value.
                        # Set false to set absolute value to the FPS.
    Value    = 150       # Set value of new frame rate
    
    Auto     = false    # Set to true to raise the frame rate automatically.
                        # Set to false to press a button to raise the fps.
    Button   = "Z"    # Set Input button
  end
end

#==============================================================================
# ** Graphics
#------------------------------------------------------------------------------
#  The module that carries out graphics processing.
#==============================================================================

module Graphics
  class << self
    #--------------------------------------------------------------------------
    # * Alias Listings
    #--------------------------------------------------------------------------
    unless method_defined?(:pk8_frsu_update)
      alias_method(:pk8_frsu_update, :update)
    end
    #--------------------------------------------------------------------------
    # * Frame Update
    #--------------------------------------------------------------------------
    
    def update(*args)
      if PK8::Framerate_Speedup::Switch == true and $DEBUG
        button = PK8::Framerate_Speedup::Button
        button = eval("Input::#{button}") if button.is_a?(String)
        real_fps = self.frame_rate
        if PK8::Framerate_Speedup::Relative == true
          new_fps = real_fps + PK8::Framerate_Speedup::Value
        else
          new_fps = PK8::Framerate_Speedup::Value
        end
          
        
        if PK8::Framerate_Speedup::Auto == true; self.frame_rate = new_fps
        else; self.frame_rate = (Input.press?(button) ? new_fps : real_fps)
        end
      end
      pk8_frsu_update(*args)
      if PK8::Framerate_Speedup::Switch == true and $DEBUG
        self.frame_rate = real_fps
      end
    end
    end
end
You need to put code into a code block at the very least. Part of the code is now changed to smiley faces.
Code:
What maker are you using and what maker is this for?
You need to put code into a code block at the very least. Part of the code is now changed to smiley faces.
Code:
What maker are you using and what maker is this for?
Hi! Sorry for the script not in the code block i need this for rpg maker xp 😀

Ruby:
=begin
 
 Speed Up Frame Rate During Test Play (Snippet)
 by PK8
 Created: 6/15/12
 Modified: -
 ──────────────────────────────────────────────────────────────────────────────
 ■ Author's Notes
   I made it mainly so I can wade through an unskippable cutscene for a project
   I was testing out.
 ──────────────────────────────────────────────────────────────────────────────
 ■ Introduction
   This script lets you speed up the frame rate of your project either
   automatically or with the touch of a button during test play. Useful if you
   really want to speed up battles, unskippable cutscenes, or whatever else you
   want to fast forward through during test play.
 ──────────────────────────────────────────────────────────────────────────────
 ■ Features
   o Speed up the frame rate of your game via button press or automatically
     while testplaying.
   o Set the value of the new frame rate. Can be absolute or relative.
 ──────────────────────────────────────────────────────────────────────────────
 ■ Changelog (MM/DD/YYYY)
   o v1    (06/15/2012): Initial Release
 ──────────────────────────────────────────────────────────────────────────────
 ■ Methods Aliased
   Graphics.update
 ──────────────────────────────────────────────────────────────────────────────
 ■ Thanks
   EJlol and Kore for watching me script it during a stream.

=end

#==============================================================================
# ** CONFIGURATION
#==============================================================================

module PK8
  class Framerate_Speedup
    #--------------------------------------------------------------------------
    # * General Settings
    #--------------------------------------------------------------------------
    
    Switch   = true    # Set true to enable. Set false to disable.
 
    Relative = false     # Set true to raise FPS relative to the value.
                        # Set false to set absolute value to the FPS.
    Value    = 150       # Set value of new frame rate
    
    Auto     = false    # Set to true to raise the frame rate automatically.
                        # Set to false to press a button to raise the fps.
    Button   = "Z"    # Set Input button
  end
end

#==============================================================================
# ** Graphics
#------------------------------------------------------------------------------
#  The module that carries out graphics processing.
#==============================================================================

module Graphics
  class << self
    #--------------------------------------------------------------------------
    # * Alias Listings
    #--------------------------------------------------------------------------
    unless method_defined?(:pk8_frsu_update)
      alias_method(:pk8_frsu_update, :update)
    end
    #--------------------------------------------------------------------------
    # * Frame Update
    #--------------------------------------------------------------------------
    
    def update(*args)
      if PK8::Framerate_Speedup::Switch == true and $DEBUG
        button = PK8::Framerate_Speedup::Button
        button = eval("Input::#{button}") if button.is_a?(String)
        real_fps = self.frame_rate
        if PK8::Framerate_Speedup::Relative == true
          new_fps = real_fps + PK8::Framerate_Speedup::Value
        else
          new_fps = PK8::Framerate_Speedup::Value
        end
          
        
        if PK8::Framerate_Speedup::Auto == true; self.frame_rate = new_fps
        else; self.frame_rate = (Input.press?(button) ? new_fps : real_fps)
        end
      end
      pk8_frsu_update(*args)
      if PK8::Framerate_Speedup::Switch == true and $DEBUG
        self.frame_rate = real_fps
      end
    end
    end
end
the code block
That's great, but you should edit your original post not add on another one.
I can't assist with this as I do not use XP.
The real time battle part was easy peasy.

" and $DEBUG"

Remove that twice and it'll work at any time and not just while playtesting your game.

Original thread: https://forums.rpgmakerweb.com/threads/i-need-help-to-modify-a-small-script.121365/