Himeworks command manager and yanfly class system combination

The gist of it is this—please read carefully—there are two scripts. The first, Hime's, allows you to choose which commands (attack, defense, magic, etc.) are available to a character and character class in battle. The second, Yanfly's, has a class and subclass system with free choice of the first and second.

The problem is this: in a typical situation (when you only have Hime's script), we assign attack and defense to a character, black magic to the black mage class, and white magic to the white mage class. Let's say Vivi is a black mage, so his available commands are attack, defense, and black magic. This works out of the box, without any scripts, but I'm just writing this as an example.

But if you connect Yanfly's class system with Hime's script (specifying which skill type is available to which class in the notetags) and select a black mage as your main class and a white mage as your subclass, only the skills of your main class are available. Without Hime's script, everything works as expected, of course.

Why do I need help if the only problem is the script combination? I just want to make items a separate skill type (basically, skills that require items to use) so it's like the Chemist class in Final Fantasy Tactics so i remove "items" command with first script but "skills" from subclass not register with Hime script..

First script from Hime
Second script from Yanfly
Hello, will this small patch do? I added the subclass's commands after the main class.

Ruby:
#Yanfly's classes + Hime's Commands patch
#Load order:
#Hime's commands
#Yanfly's classes
#this patch

#==============================================================================
# Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
  #-----------------------------------------------------------------------------
  # new method: initial_commands -> creates a new method to load battler's
  # commands
  #-----------------------------------------------------------------------------
  def initial_commands
    l = actor.initial_commands + self.class.initial_commands
    l += subclass.initial_commands if subclass
    return l
  end
 
  #-----------------------------------------------------------------------------
  # overwrite method: init_commands -> rewrites hime's method to include
  # subclass commands
  #-----------------------------------------------------------------------------
  def init_commands
    @base_commands = []
    cmds = initial_commands
    if cmds.empty?
      add_command_attack([])
      add_command_guard([])
      add_command_skill_list([])
      add_command_item([])
    else
      cmds.each do |cmd|
        method_name = "add_command_#{cmd[0]}"
        send(method_name, cmd[1..-1]) if respond_to?(method_name)
      end
    end
  end
 
  #-----------------------------------------------------------------------------
  # alias method: change_subclass -> ensures the commands are modified
  #-----------------------------------------------------------------------------
  alias hime_cmds_change_subclass change_subclass
  def change_subclass(class_id)
    hime_cmds_change_subclass(class_id)
    init_commands
  end
end #Game_Actor
Whoa! That was fast. And at first glance, it works exactly as I need it! Thank you so much!

Original thread: https://forums.rpgmakerweb.com/threads/himeworks-command-manager-and-yanfly-class-system-combination.181169/