A little patch for certain scripts

Good morning...
Thanks to @Timtrack for solving a problem in my previous thread. The system is working fine.

Now I wanted to try another aproach with Moghunter's script: Mog Battle result.

But there's an issue:
From the immages I issued here I put the level of my enemy here, also the formula

But with moghunter's script Battle result

There's no exp bonuss from the difference, on the base exp.

Is there any patch for this problem? Thank you.

Script that I used:
https://himeworks.com/redirect.php?type=script&name=Core_Enemy_Levels
https://himeworks.com/redirect.php?type=script&name=Actor_Victory_Exp
https://himeworks.com/redirect.php?type=script&name=Level_Difference_Exp

Game i used for testing: https://darkkyu09.itch.io/rakenzarn-tales
I found a bit of time, so here is a compatibility patch:
Ruby:
#==============================================================================
# Hime Level Difference Exp + MOG - Battle Result patch
#------------------------------------------------------------------------------
# Author: Timtrack
# date: 15/02/2026
# Requires: Hime Level Difference Exp, MOG - Battle Result 2.0 and their
#           requirements 
#==============================================================================
# Description: Fix the display of the exp on MOG Battle Result script to show
# the exp of the party leader instead of the default battlers exp.
# Exp rewarded should now be tied to the actors
#==============================================================================
# Load order:
# Hime's script
# Mog's script
# this patch
#==============================================================================

#==============================================================================
# Battle_Result
#==============================================================================
class Battle_Result
  #--------------------------------------------------------------------------
  # overwrite method: create_victory_exp
  #--------------------------------------------------------------------------     
  def create_victory_exp
    @exp_number = Sprite.new
    @exp_number.bitmap = Bitmap.new(@result_number.width, @result_ch)
    @exp_number.z = 1002
    @exp_number.y = RESULT_EXP_POSITION[1]
    @exp_number.zoom_x = 2
    @exp_number.zoom_y = 2
    @exp_total = exp_total #modified line
    @exp_number.opacity = 0
    @exp_old = 0
    @exp_ref = ((1 * @exp_total) / 111).truncate rescue nil
    @exp_ref = 1 if @exp_ref < 1 or @exp_ref == nil     
    @exp_ref = 0 if @exp_total == 0
    refresh_exp_number
  end
 
  #--------------------------------------------------------------------------
  # new method: exp_total
  #--------------------------------------------------------------------------
  def exp_total
    $game_party.members.empty? ? $game_troop.exp_total :
                                 $game_party.leader.gained_exp.to_i
  end
 
  #--------------------------------------------------------------------------
  # new method: level_parameter_old
  #--------------------------------------------------------------------------
  def level_parameter_old(b)
    [b.level] + 0.upto(7).map{|i| b.param(i)}
  end
 
  #--------------------------------------------------------------------------
  # new method: clear_result_data
  #--------------------------------------------------------------------------
  def clear_result_data
    @new_skills = nil
    @new_skills_index = 0
    $game_temp.level_parameter = []
    $game_temp.level_parameter_old = []
  end
 
  #--------------------------------------------------------------------------
  # new method: gain_exp -> compatbility with Hime's script
  #-------------------------------------------------------------------------- 
  def gain_exp(bat)
    bat.gain_exp(bat.gained_exp)
  end
 
  #--------------------------------------------------------------------------
  # overwrite method: check_level_up -> split the method into submethods,
  # removed most nil case checks
  #--------------------------------------------------------------------------           
  def check_level_up
    return show_new_skill if @new_skills && !@new_skills.empty?
    @result_member_id.upto(@result_member_max-1) do |id|
      clear_result_data
      bat = $game_party.members[id]
      $game_temp.level_parameter_old = level_parameter_old(bat)
      gain_exp(bat)
      @result_member_id = id + 1 #ensure only once call
      return show_level_result(bat) unless $game_temp.level_parameter.empty?
    end
    #end of loop
    @victory_phase = 10
  end
 
  #--------------------------------------------------------------------------
  # overwrite method: show_level_result -> add actor as parameter instead of
  # handling nil cases
  #--------------------------------------------------------------------------             
  def show_level_result(actor)
    return unless actor
    Sound.play_cursor
    @actor_result = actor
    @actor_result.animation_id = RESULT_LEVELUP_ANIMATION_ID
    @fade_result_window = true
    create_levelup
    create_level
    create_parameter_number
    create_result_actor
    create_new_skill_window
  end
end #Battle_Result

I only tested it on an empty project with Hime's scripts and Mog's result script.

I don't know about the decrypting part, but unless you have permission from the game creator (in which case they could probably share their project or files), I would advise against using it.
Thank you. I'll test it right away
I found a bit of time, so here is a compatibility patch:
Ruby:
#==============================================================================
# Hime Level Difference Exp + MOG - Battle Result patch
#------------------------------------------------------------------------------
# Author: Timtrack
# date: 15/02/2026
# Requires: Hime Level Difference Exp, MOG - Battle Result 2.0 and their
#           requirements
#==============================================================================
# Description: Fix the display of the exp on MOG Battle Result script to show
# the exp of the party leader instead of the default battlers exp.
# Exp rewarded should now be tied to the actors
#==============================================================================
# Load order:
# Hime's script
# Mog's script
# this patch
#==============================================================================

#==============================================================================
# Battle_Result
#==============================================================================
class Battle_Result
  #--------------------------------------------------------------------------
  # overwrite method: create_victory_exp
  #--------------------------------------------------------------------------    
  def create_victory_exp
    @exp_number = Sprite.new
    @exp_number.bitmap = Bitmap.new(@result_number.width, @result_ch)
    @exp_number.z = 1002
    @exp_number.y = RESULT_EXP_POSITION[1]
    @exp_number.zoom_x = 2
    @exp_number.zoom_y = 2
    @exp_total = exp_total #modified line
    @exp_number.opacity = 0
    @exp_old = 0
    @exp_ref = ((1 * @exp_total) / 111).truncate rescue nil
    @exp_ref = 1 if @exp_ref < 1 or @exp_ref == nil    
    @exp_ref = 0 if @exp_total == 0
    refresh_exp_number
  end
 
  #--------------------------------------------------------------------------
  # new method: exp_total
  #--------------------------------------------------------------------------
  def exp_total
    $game_party.members.empty? ? $game_troop.exp_total :
                                 $game_party.leader.gained_exp.to_i
  end
 
  #--------------------------------------------------------------------------
  # new method: level_parameter_old
  #--------------------------------------------------------------------------
  def level_parameter_old(b)
    [b.level] + 0.upto(7).map{|i| b.param(i)}
  end
 
  #--------------------------------------------------------------------------
  # new method: clear_result_data
  #--------------------------------------------------------------------------
  def clear_result_data
    @new_skills = nil
    @new_skills_index = 0
    $game_temp.level_parameter = []
    $game_temp.level_parameter_old = []
  end
 
  #--------------------------------------------------------------------------
  # new method: gain_exp -> compatbility with Hime's script
  #--------------------------------------------------------------------------
  def gain_exp(bat)
    bat.gain_exp(bat.gained_exp)
  end
 
  #--------------------------------------------------------------------------
  # overwrite method: check_level_up -> split the method into submethods,
  # removed most nil case checks
  #--------------------------------------------------------------------------          
  def check_level_up
    return show_new_skill if @new_skills && !@new_skills.empty?
    @result_member_id.upto(@result_member_max-1) do |id|
      clear_result_data
      bat = $game_party.members[id]
      $game_temp.level_parameter_old = level_parameter_old(bat)
      gain_exp(bat)
      @result_member_id = id + 1 #ensure only once call
      return show_level_result(bat) unless $game_temp.level_parameter.empty?
    end
    #end of loop
    @victory_phase = 10
  end
 
  #--------------------------------------------------------------------------
  # overwrite method: show_level_result -> add actor as parameter instead of
  # handling nil cases
  #--------------------------------------------------------------------------            
  def show_level_result(actor)
    return unless actor
    Sound.play_cursor
    @actor_result = actor
    @actor_result.animation_id = RESULT_LEVELUP_ANIMATION_ID
    @fade_result_window = true
    create_levelup
    create_level
    create_parameter_number
    create_result_actor
    create_new_skill_window
  end
end #Battle_Result

I only tested it on an empty project with Hime's scripts and Mog's result script.

I don't know about the decrypting part, but unless you have permission from the game creator (in which case they could probably share their project or files), I would advise against using it.
Is it compatible with victor engine? At least a little modification for the victor engine scripts to, just in case
If you refer to Victor Core Engine, then it should be compatible, but you should put it above your other scripts to ensure compatibility (especially with Hime's scripts)
For the rest of Victor's scripts I don't know. If you encounter compatibility issues you can indicate them (and tell which script(s) from Victor are creating such issue).
If you refer to Victor Core Engine, then it should be compatible, but you should put it above your other scripts to ensure compatibility (especially with Hime's scripts)
For the rest of Victor's scripts I don't know. If you encounter compatibility issues you can indicate them (and tell which script(s) from Victor are creating such issue).
ok

Original thread: https://forums.rpgmakerweb.com/threads/a-little-patch-for-certain-scripts.182415/