by Dargor
Version 1.0
Introduction
It's been a while since I have posted something here so I thought I should release something new!
This script is based on Star Ocean 3 Bonus Battle system. When filling a bonus gauge with certain action such as using a skill or killing an enemy, the party enters in the Bonus Battle mode and gain bonuses as long as the bonus gauge is filled. The bonus gauge can be broken if a party member is killed or hit by a critical hit.
Screenshots


Script
Code:
#==============================================================================
# ** Bonus Battles
#------------------------------------------------------------------------------
# Â© Dargor, 2008
#Â 09/08/08
#Â Version 1.0
#------------------------------------------------------------------------------
#Â VERSION HISTORY:
#Â - 1.0 (09/08/08), Initial release
#------------------------------------------------------------------------------
#Â INTRODUCTION:
#Â Â This script is based on Star Ocean 3 Bonus Battle system.
#Â Â When filling a bonus gauge with certain action such as
#Â Â using a skill or killing an enemy, the party enters in the
#Â Â Bonus Battle mode and gain bonuses as long as the bonus gauge is filled
#Â Â The bonus gauge can be broken if a party member is killed or hit by
#Â Â a critical hit.
#------------------------------------------------------------------------------
#Â INSTRUCTIONS:
#Â - Paste this above main
#Â - Edit the constants in Bonus_Battles moduleÂ
#------------------------------------------------------------------------------
#Â NOTES:
#Â - This script supports only 4 bonuses
#Â Â Â 1) Double Gold
#Â Â Â 2) Double EXP
#Â Â Â 3) Increase chances of finding items
#Â Â Â 4) Increase chances of preemptive strikes
#==============================================================================
# Vocabulary
Vocab::BonusBattle = 'BONUS BATTLE!'
#==============================================================================
# ** Bonus Battle Configuration Module
#==============================================================================
module Bonus_Battles
 # The maximum rate (in percent) the bonus gauge can get
 Max_Rate = 300
 # The maximum amount of points the gauge needs to be filled
 Gauge_Max = 100
 # Gauge colors
 Gauge_Color_1 = 29
 Gauge_Color_2 = 28
 Back_Color = 19
 # Time (in seconds) before the bonus rate drops
 Decrease_Time = 2
 # Sound effects
 Gauge_Filled_SE = 'Heal1'
 Gauge_Break_SE = 'Battle2'
 Bonus_Battle_ME = 'Fanfare1'
 Play_Bonus_Battle_ME = false
 # Bonus Points gained
 Attack_Points = 1
 Skill_Points = 2
 Critical_Points = 4
 Kill_Points = 8
 # Automatically gain bonus if in Bonus Battle.
 Auto_Gain_Bonus = true
 # Order of auto-gained bonus
 Auto_Order = [1,3,4,2]
 # Gain a bonus at each X chain battles
 # (Works only when Auto_Gain_Bonus = true)
 Bonus_Chain = 5
 # Preemptive Multiplier (When party has the Preemptive bonus)
 # VX original preemptive/surprise depends on the average party and
 # troop agility. If the party's average agility is higher than the
 # troop's average agility:
 # Preemptive chance = 5%, Surprise chance = 3%
 # If the troop's average agility is higher than the party's average
 # agility:
 # Preemptive chance = 3%, Surprise chance = 5%
 Preemptive_Multiplier = 4
end
#==============================================================================
# ** Sound
#------------------------------------------------------------------------------
#Â This module plays sound effects. It obtains sound effects specified in the
# database from $data_system, and plays them.
#==============================================================================
module Sound
 # Bonus Battle Gauge Break
 def self.play_gauge_break
  se = RPG::SE.new(Bonus_Battles::Gauge_Break_SE)
  se.play
 end
 # Bonus Battle Gauge Filled
 def self.play_gauge_filled
  se = RPG::SE.new(Bonus_Battles::Gauge_Filled_SE)
  se.play
 end
end
#==============================================================================
# ** SRPG::Enemt::DropItem
#==============================================================================
module RPG
 class Enemy
  class DropItem
   #------------------------------------------------------------------------
   # * Denominator
   #------------------------------------------------------------------------
   def denominator
    if $game_party.increase_items?
     return @denominator / 2
    else
     return @denominator
    end
   end
  end
 end
end
#==============================================================================
# ** Game_Unit
#------------------------------------------------------------------------------
#Â This class handles units. It's used as a superclass of the Game_Party and
# Game_Troop classes.
#==============================================================================
class Game_Unit
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------
 def total_agi
  result = 0
  for member in members
   result += member.agi
  end
  return result
 end
end
#==============================================================================
# ** Game_System
#------------------------------------------------------------------------------
#Â This class handles system-related data. Also manages vehicles and BGM, etc.
# The instance of this class is referenced by $game_system.
#==============================================================================
class Game_Party
 #--------------------------------------------------------------------------
 # * Public Instance Variables
 #--------------------------------------------------------------------------
 attr_accessor :bonus_battles
 attr_accessor :bonus_gauge
 attr_accessor :last_bonus_gauge
 attr_accessor :battle_bonuses
 attr_accessor :gauge_rate
 #--------------------------------------------------------------------------
 # * Alias Listing
 #--------------------------------------------------------------------------
 alias dargor_vx_bonus_gauge_party_initialize initialize
 alias dargor_vx_bonus_gauge_party_average_agi average_agi
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------
 def initialize
  dargor_vx_bonus_gauge_party_initialize
  @bonus_battles = 0
  @bonus_gauge = 20
  @battle_bonuses = []
  @last_bonus_gauge = @bonus_gauge
  @gauge_rate = 200
 end
 #--------------------------------------------------------------------------
 # * Add Battle Bonus
 #--------------------------------------------------------------------------
 def add_battle_bonus(type)
  return unless can_add_bonus?
  if !@battle_bonuses.empty? &&
    (Bonus_Battles::Auto_Gain_Bonus or type == 0)
   auto_add_battle_bonus
  else
   @battle_bonuses << type
  end
  @battle_bonuses.sort!
  @battle_bonuses.uniq!
 end
 #--------------------------------------------------------------------------
 # * Auto Add Battle Bonus
 #--------------------------------------------------------------------------
 def auto_add_battle_bonus
  for i in Bonus_Battles::Auto_Order
   if !@battle_bonuses.include?(i)
    @battle_bonuses << i
    return
   end
  end
 end
 #--------------------------------------------------------------------------
 # * Can Add Battle Bonus?
 #--------------------------------------------------------------------------
 def can_add_bonus?
  if @battle_bonuses.size == 0
   result = Integer(@bonus_gauge) >= Bonus_Battles::Gauge_Max
   @bonus_gauge = [@bonus_gauge, Bonus_Battles::Gauge_Max].min
   return result
  elsif @bonus_battles > 0
   result = @bonus_battles % Bonus_Battles::Bonus_Chain == 0
   return result
  end
  return false
 end
 #--------------------------------------------------------------------------
 # * Get Adjusted Gauge Rate
 #--------------------------------------------------------------------------
 def get_adjusted_gauge_rate
  agi_total = [average_agi, $game_troop.average_agi]
  agi_min = agi_total.min
  agi_max = agi_total.max
  difference = (agi_min * 100) / agi_max
  if average_agi >= $game_troop.average_agi
   difference -= 1 until difference % 10 == 0
   rate = 100 - ((difference / 2) + ($game_party.members.size * 10))
  else
   difference += 1 until difference % 10 == 0
   rate = 100 + ((difference / 2) + ($game_troop.members.size * 10))
  end
  rate = [[rate, Bonus_Battles::Max_Rate].min, 0].max
  return rate
 end
 #--------------------------------------------------------------------------
 # * Calculate Average Agility
 #--------------------------------------------------------------------------
 def average_agi
  result = dargor_vx_bonus_gauge_party_average_agi
  result *= 2 if increase_preemptive?
  return result
 end
 #--------------------------------------------------------------------------
 # * Increase Gold Bonus
 #--------------------------------------------------------------------------
 def increase_gold?
  return @battle_bonuses.include?(1)
 end
 #--------------------------------------------------------------------------
 # * Increase EXP Bonus
 #--------------------------------------------------------------------------
 def increase_exp?
  return @battle_bonuses.include?(2)
 end
 #--------------------------------------------------------------------------
 # * Increase Items Bonus
 #--------------------------------------------------------------------------
 def increase_items?
  return @battle_bonuses.include?(3)
 end
 #--------------------------------------------------------------------------
 # * Increase Preemptive Bonus
 #--------------------------------------------------------------------------
 def increase_preemptive?
  return @battle_bonuses.include?(4)
 end
end
#==============================================================================
# ** Game_Enemy
#------------------------------------------------------------------------------
#Â This class handles enemy characters. It's used within the Game_Troop class
# ($game_troop).
#==============================================================================
class Game_Enemy < Game_Battler
 #--------------------------------------------------------------------------
 # * ALias Listing
 #--------------------------------------------------------------------------
 alias dargor_vx_bonus_battle_enemy_exp exp
 alias dargor_vx_bonus_battle_enemy_gold gold
 #--------------------------------------------------------------------------
 # * Get Experience
 #--------------------------------------------------------------------------
 def exp
  result = dargor_vx_bonus_battle_enemy_exp
  result *= 2 if $game_party.increase_exp?
  return result
 end
 #--------------------------------------------------------------------------
 # * Get Gold
 #--------------------------------------------------------------------------
 def gold
  result = dargor_vx_bonus_battle_enemy_gold
  result *= 2 if $game_party.increase_gold?
  return result
 end
end
#==============================================================================
# ** Sprite_BonusGauge
#------------------------------------------------------------------------------
#Â This sprite is used to display the bonus gauge on the battle screen.
#Â It observes the $game_system bonus gauge variables and automatically
#Â changes sprite conditions.
#==============================================================================
class Sprite_BonusGauge < Sprite
 #--------------------------------------------------------------------------
 # * Public Instance Variables
 #--------------------------------------------------------------------------
 attr_accessor :rate_sprite
 attr_accessor :chain_sprite
 #--------------------------------------------------------------------------
 # * Object Initialization
 #  viewport : viewport
 #--------------------------------------------------------------------------
 def initialize(viewport)
  super(viewport)
  self.bitmap = Bitmap.new(92, 268)
  self.x = 544 - self.bitmap.width
  self.y = 16
  self.z = 200
  # Create a seperate sprite for Bonus Rate
  @rate_sprite = Sprite.new(viewport)
  @rate_sprite.bitmap = Bitmap.new(88,24)
  @rate_sprite.x = self.x
  @rate_sprite.y = 264
  @rate_sprite.z = self.z + 1
  # Create a seperate sprite for Chain Battles
  @chain_sprite = Sprite.new(viewport)
  @chain_sprite.bitmap = Bitmap.new(128,24)
  @chain_sprite.x = self.x
  @chain_sprite.y = 0
  @chain_sprite.z = self.z + 1
  @last_color = text_color(0)
  refresh
 end
 #--------------------------------------------------------------------------
 # * Dispose
 #--------------------------------------------------------------------------
 def dispose
  super
  self.bitmap.dispose
  @rate_sprite.dispose
  @chain_sprite.dispose
 end
 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------
 def refresh
  self.bitmap.clear
  @rate_sprite.bitmap.clear
  @chain_sprite.bitmap.clear
  self.bitmap.fill_rect(70,0,10,268,gauge_back_color)
  $game_party.bonus_gauge = [$game_party.bonus_gauge, Bonus_Battles::Gauge_Max].min
  bar_height = ($game_party.bonus_gauge * 264) / Bonus_Battles::Gauge_Max
  bar_y = 264 - bar_height + 2
  gc1 = bar_color_1
  gc2 = bar_color_2
  self.bitmap.gradient_fill_rect(72,bar_y,6,bar_height,gc1,gc2,true)
  rate = $game_party.gauge_rate
  case rate
  when 0
   color = knockout_color
  when 10..49
   color = crisis_color
  else
   color = Color.new(255,255,255)
  end
  if color != @last_color
   @rate_sprite.flash(@last_color, 20 * 4)
  end
  @rate_sprite.bitmap.font.color = color
  @rate_sprite.bitmap.draw_text(0,0,88,24,"#{rate}%",2)
  if $game_party.bonus_battles > 0
   chain = $game_party.bonus_battles
   @chain_sprite.bitmap.font.color = text_color(0)
   @chain_sprite.bitmap.draw_text(0,0,32,24,chain,2)
   @chain_sprite.bitmap.font.color = system_color
   @chain_sprite.bitmap.draw_text(0,0,88,24,"Chain",2)
  end
  @last_color = color
  if $game_party.bonus_gauge == Bonus_Battles::Gauge_Max &&
    $game_party.last_bonus_gauge != Bonus_Battles::Gauge_Max
   Sound.play_gauge_filled
   self.flash(Color.new(255,255,255), 20 * 4)
  end
  if $game_party.bonus_gauge == 0 &&
    $game_party.last_bonus_gauge != 0
   Sound.play_gauge_break
   self.flash(Color.new(255,255,255), 20 * 4)
  end
  $game_party.last_bonus_gauge = $game_party.bonus_gauge
 end
 #--------------------------------------------------------------------------
 # * Frame Update
 #--------------------------------------------------------------------------
 def update
  super
  @rate_sprite.update
  $game_party.bonus_gauge = [$game_party.bonus_gauge, Bonus_Battles::Gauge_Max].min
  if $game_party.bonus_gauge != @points
   refresh
  end
 end
 #--------------------------------------------------------------------------
 # * Get Text Color
 #  n : Text color number (0-31)
 #--------------------------------------------------------------------------
 def text_color(n)
  windowskin = Cache.system("Window")
  x = 64 + (n % 8) * 8
  y = 96 + (n / 8) * 8
  return windowskin.get_pixel(x, y)
 end
 #--------------------------------------------------------------------------
 # * Get System Text Color
 #--------------------------------------------------------------------------
 def system_color
  return text_color(16)
 end
 #--------------------------------------------------------------------------
 # * Get Crisis Text Color
 #--------------------------------------------------------------------------
 def crisis_color
  return text_color(17)
 end
 #--------------------------------------------------------------------------
 # * Get Knockout Text Color
 #--------------------------------------------------------------------------
 def knockout_color
  return text_color(18)
 end
 #--------------------------------------------------------------------------
 # * Get Gauge First Color
 #--------------------------------------------------------------------------
 def bar_color_1
  return text_color(Bonus_Battles::Gauge_Color_1)
 end
 #--------------------------------------------------------------------------
 # * Get Gauge Second Color
 #--------------------------------------------------------------------------
 def bar_color_2
  return text_color(Bonus_Battles::Gauge_Color_2)
 end
 #--------------------------------------------------------------------------
 # * Get Gauge Background Color
 #--------------------------------------------------------------------------
 def gauge_back_color
  return text_color(Bonus_Battles::Back_Color)
 end
end
#==============================================================================
# ** Sprite_Battler
#------------------------------------------------------------------------------
#Â This sprite is used to display battlers. It observes a instance of the
# Game_Battler class and automatically changes sprite conditions.
#==============================================================================
class Game_Battler
 #--------------------------------------------------------------------------
 # * Alias Listing
 #--------------------------------------------------------------------------
 alias dargor_vx_bonus_battles_battler_make_attack_damage_value make_attack_damage_value
 alias dargor_vx_bonus_battles_battler_skill_effect skill_effect
 #--------------------------------------------------------------------------
 # * Calculation of Damage From Normal Attack
 #  attacker : Attacker
 #  The results are substituted for @hp_damage
 #--------------------------------------------------------------------------
 def make_attack_damage_value(attacker)
  dargor_vx_bonus_battles_battler_make_attack_damage_value(attacker)
  if attacker.is_a?(Game_Actor)
   if @critical
    # Do not add points for critical hit if the hit kills the target.
    # Instead, add points for killing the target.
    unless @hp_damage >= self.hp
     points = Bonus_Battles::Critical_Points
     points *= $game_party.gauge_rate.to_f / 100
     $game_party.bonus_gauge += points
     # Gain bonus for filling the bonus gauge with a critical hit
     $game_party.add_battle_bonus(3)
    end
   elsif @hp_damage > 0 or @mp_damage > 0
    # Do not add points for hitting if the hit kills the target.
    # Instead, add points for killing the target.
    unless @hp_damage >= self.hp
     points = Bonus_Battles::Attack_Points
     points *= $game_party.gauge_rate.to_f / 100
     $game_party.bonus_gauge += points
     # Gain bonus for filling the bonus gauge with an attack
     $game_party.add_battle_bonus(1)
    end
   end
  else
   # Break bonus gauge if hit by a critical
   if @critical
    $game_party.bonus_gauge = 0
    $game_party.bonus_battles = 0
    $game_party.battle_bonuses = []
   end
  end
 end
 #--------------------------------------------------------------------------
 # * Apply Skill Effects
 #  user : Skill user
 #  skill : skill
 #--------------------------------------------------------------------------
 def skill_effect(user, skill)
  dargor_vx_bonus_battles_battler_skill_effect(user, skill)
  if user.is_a?(Game_Actor)
   # Do not add points for using skill if the skill kills the target.
   # Instead, add points for killing the target.
   unless @hp_damage >= self.hp
    points = Bonus_Battles::Skill_Points
    points *= $game_party.gauge_rate.to_f / 100
    $game_party.bonus_gauge += points
    # Gain bonus for filling the bonus gauge with an skill
   $game_party.add_battle_bonus(2)
   end
  end
 end
end
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
#Â This class handles actors. It's used within the Game_Actors class
# ($game_actors) and referenced by the Game_Party class ($game_party).
#==============================================================================
class Game_Actor < Game_Battler
 #--------------------------------------------------------------------------
 # * Alias Listing
 #--------------------------------------------------------------------------
 alias dargor_vx_bonus_battles_actor_perform_collapse perform_collapse
 #--------------------------------------------------------------------------
 # * Perform Collapse
 #--------------------------------------------------------------------------
 def perform_collapse
  dargor_vx_bonus_battles_actor_perform_collapse
  if $game_temp.in_battle and dead?
   $game_party.bonus_gauge = 0
   $game_party.bonus_battles = 0
   $game_party.battle_bonuses = []
  end
 end
end
#==============================================================================
# ** Game_Enemy
#------------------------------------------------------------------------------
#Â This class handles enemy characters. It's used within the Game_Troop class
# ($game_troop).
#==============================================================================
class Game_Enemy < Game_Battler
 #--------------------------------------------------------------------------
 # * Alias Listing
 #--------------------------------------------------------------------------
 alias dargor_vx_bonus_battles_enemy_perform_collapse perform_collapse
 #--------------------------------------------------------------------------
 # * Perform Collapse
 #--------------------------------------------------------------------------
 def perform_collapse
  dargor_vx_bonus_battles_enemy_perform_collapse
  if $game_temp.in_battle and dead?
   points = Bonus_Battles::Kill_Points
   points *= $game_party.gauge_rate.to_f / 100
   $game_party.bonus_gauge += points
   # Gain bonus for filling the bonus gauge by killing an enemy
   $game_party.add_battle_bonus(4)
  end
 end
end
#==============================================================================
# ** Spriteset_Battle
#------------------------------------------------------------------------------
#Â This class brings together battle screen sprites. It's used within the
# Scene_Battle class.
#==============================================================================
class Spriteset_Battle
 #--------------------------------------------------------------------------
 # * Public Instance Variables
 #--------------------------------------------------------------------------
 attr_accessor :bonus_gauge
 #--------------------------------------------------------------------------
 # * Create Picture Sprite
 #--------------------------------------------------------------------------
 alias dargor_vx_bonus_battles_spriteset_create_pictures create_pictures
 alias dargor_vx_bonus_battles_spriteset_dispose_pictures dispose_pictures
 alias dargor_vx_bonus_battles_spriteset_update_pictures update_pictures
 #--------------------------------------------------------------------------
 # * Create Picture Sprite
 #--------------------------------------------------------------------------
 def create_pictures
  dargor_vx_bonus_battles_spriteset_create_pictures
  @bonus_gauge = Sprite_BonusGauge.new(@viewport2)
 end
 #--------------------------------------------------------------------------
 # * Dispose of Picture Sprite
 #--------------------------------------------------------------------------
 def dispose_pictures
  dargor_vx_bonus_battles_spriteset_dispose_pictures
  @bonus_gauge.dispose
 end
 #--------------------------------------------------------------------------
 # *Update Picture Sprite
 #--------------------------------------------------------------------------
 def update_pictures
  dargor_vx_bonus_battles_spriteset_update_pictures
  @bonus_gauge.update
 end
end
#==============================================================================
# ** Window_BonusBattle
#------------------------------------------------------------------------------
#Â This window displays battle bonuses on the battle screen.
#==============================================================================
class Window_BonusBattle < Window_Base
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------
 def initialize
  super(0, 0, 544, 160)
  self.opacity = 0
  self.openness = 0
  create_back_sprite
  refresh
 end
 #--------------------------------------------------------------------------
 # * refresh
 #--------------------------------------------------------------------------
 def refresh
  self.contents.clear
  self.contents.font.size = 24
  self.contents.font.color = crisis_color
  self.contents.draw_text(0,0,504,WLH,Vocab::BonusBattle,1)
  self.contents.font.size = 20
  self.contents.font.color = normal_color
  return if $game_party.battle_bonuses.size == 0
  for i in 0...$game_party.battle_bonuses.size
   bonus = $game_party.battle_bonuses[i]
   x = i % 1 * 272
   y = i / 1 * WLH
   case bonus
   when 1
    text = 'Double Gold'
   when 2
    text = 'Double EXP'
   when 3
    text = 'Raise chances of finding items'
   when 4
    text = 'Raise chances of preemptive strikes'
   end
   self.contents.draw_text(x,y + WLH,504,WLH,text)
  end
 end
 #--------------------------------------------------------------------------
 # * Create Background Sprite
 #--------------------------------------------------------------------------
 def create_back_sprite
  @back_sprite = Sprite.new
  @back_sprite.bitmap = Cache.system("MessageBack")
  @back_sprite.opacity = openness
  @back_sprite.z = self.z - 1
 end
 #--------------------------------------------------------------------------
 # * Dispose of Background Sprite
 #--------------------------------------------------------------------------
 def dispose_back_sprite
  @back_sprite.dispose
 end
 #--------------------------------------------------------------------------
 # * Update Background Sprite
 #--------------------------------------------------------------------------
 def update_back_sprite
  @back_sprite.opacity = openness
  @back_sprite.update
 end
 #--------------------------------------------------------------------------
 # * Dispose
 #--------------------------------------------------------------------------
 def dispose
  super
  dispose_back_sprite
 end
 #--------------------------------------------------------------------------
 # * Update
 #--------------------------------------------------------------------------
 def update
  super
  update_back_sprite
 end
end
#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
#Â This is a superclass of all windows in the game.
#==============================================================================
class Window_Base < Window
 #--------------------------------------------------------------------------
 # * Public Instance Variables
 #--------------------------------------------------------------------------
 attr_reader :opening
end
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
#Â This class performs the map screen processing.
#==============================================================================
class Scene_Map < Scene_Base
 #--------------------------------------------------------------------------
 # * Alias Listing
 #--------------------------------------------------------------------------
 alias dargor_vx_bonus_battle_map_preemptive_or_surprise preemptive_or_surprise
 #--------------------------------------------------------------------------
 # * Determine Preemptive Strike and Surprise Attack Chance
 #--------------------------------------------------------------------------
 def preemptive_or_surprise
  if $game_party.increase_preemptive?
   actors_agi = $game_party.average_agi
   enemies_agi = $game_troop.average_agi
   if actors_agi >= enemies_agi
    percent_preemptive = 5 * Bonus_Battles::Preemptive_Multiplier
    percent_surprise = 3
   else
    percent_preemptive = 3 * Bonus_Battles::Preemptive_Multiplier
    percent_surprise = 5
   end
   if rand(100) < percent_preemptive
    $game_troop.preemptive = true
   elsif rand(100) < percent_surprise
    $game_troop.surprise = true
   end
  else
   dargor_vx_bonus_battle_map_preemptive_or_surprise
  end
 end
end
#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
#Â This class performs battle screen processing.
#==============================================================================
class Scene_Battle < Scene_Base
 #--------------------------------------------------------------------------
 # * Alias Listing
 #--------------------------------------------------------------------------
 alias dargor_vx_bonus_battles_battle_start start
 alias dargor_vx_bonus_battles_battle_terminate terminate
 alias dargor_vx_bonus_battles_battle_update_basic update_basic
 alias dargor_vx_bonus_battles_battle_execute_action execute_action
 #--------------------------------------------------------------------------
 # * Start Processing
 #--------------------------------------------------------------------------
 def start
  # Increase bonus battle count
  if $game_party.bonus_gauge == Bonus_Battles::Gauge_Max
   $game_party.bonus_battles += 1
  end
  # Auto-gain bonuses
  $game_party.add_battle_bonus(0)
  # Set gauge rate
  $game_party.gauge_rate = $game_party.get_adjusted_gauge_rate
  # Create bonus window
  @bonus_window = Window_BonusBattle.new
  @bonus_window.open if $game_party.bonus_battles > 0
  @last_party_bonus = $game_party.battle_bonuses
  dargor_vx_bonus_battles_battle_start
 end
 #--------------------------------------------------------------------------
 # * Start Processing
 #--------------------------------------------------------------------------
 def terminate
  dargor_vx_bonus_battles_battle_terminate
  @bonus_window.dispose
 end
 #--------------------------------------------------------------------------
 # * Basic Update Processing
 #  main : Call from main update method
 #--------------------------------------------------------------------------
 def update_basic(main = false)
  @bonus_window.update
  update_bonus_gauge     # Update the bonus gauge
  update_bonus_window    # Update the bonus window
  # Close the bonus window
  if Input.trigger?(Input::C)
   @bonus_window.close
  end
  # The usual
  dargor_vx_bonus_battles_battle_update_basic(main)
 end
 #--------------------------------------------------------------------------
 # * Frame Update (Bonus gauge)
 #--------------------------------------------------------------------------
 def update_bonus_gauge
  if update_bonus_gauge?
   $game_party.gauge_rate = [$game_party.gauge_rate -= 10, 0].max
   @spriteset.bonus_gauge.refresh
  end
 end
 #--------------------------------------------------------------------------
 # * Frame Update (Bonus window)
 #--------------------------------------------------------------------------
 def update_bonus_window
  if ($game_party.bonus_gauge == Bonus_Battles::Gauge_Max &&
    $game_party.last_bonus_gauge != Bonus_Battles::Gauge_Max) or
    ($game_party.battle_bonuses != @last_party_bonus)
   @bonus_window.refresh
   @bonus_window.open
   @bonus_me = RPG::ME.new
   @bonus_me.name = Bonus_Battles::Bonus_Battle_ME
   @bonus_me.play if Bonus_Battles::Play_Bonus_Battle_ME
   if $game_party.battle_bonuses != @last_party_bonus
    @last_party_bonus = $game_party.battle_bonuses
   end
  end
 end
 #--------------------------------------------------------------------------
 # * Update Bonus Gauge?
 #--------------------------------------------------------------------------
 def update_bonus_gauge?
  time = Bonus_Battles::Decrease_Time * 60
  result = true
  result &&= @party_command_window.active == false
  result &&= @message_window.visible == false
  result &&= Graphics.frame_count % time == 0
  return result
 end
end
Note
This script supports only 4 bonuses
1) Double Gold
2) Double EXP
3) Increase chances of finding items
4) Increase chances of preemptive strikes
Also, the algorithm for the gauge rate isn't final yet.
Enjoy!
-Dargor