[VX ACE] Displaying Certain Values/Text in Yami's Skill Equip

Awesome!! Thank you so much!
There's one other request I have for you at the moment. Would it be possible to make it so you're unable to use tech point recovery items if all of your current skills are at their max tech points? Like, if you tried using an HP recovery item at full health, and how it plays the buzzer noise.

Edit: I was also wondering if it'd be possible to remove the "[Actor] took no damage!" message after using a tech point recovery item. I know that it's caused by the lack of output in the damage formula window, but does that mean removing that message in that instance is out of the question? And if it is possible, could it also be compatible with the YEA Ace Battle Engine?
Here it all is. Note that I changed the item formula command.
Check the script header.

Script getting updated
Sorry it took a day for me to see this, I've been busy with life stuff.

Thanks for the updated script! The returning of the item and sound help a ton, but is there any way to make a tech point recovery item completely unusable at full tech points? I'd rather not have anyone accidentally waste a turn in combat, or get confused by the "use item" sound effect occuring at the same time as the "buzzer" sound effect when using the item in the overworld.

Additionally, I still have to ask if it's possible to remove the "[Actor] took no damage!" line when using a tech point recovery item in battle. Again, I know it's a product of the item formula returning a zero, but is there someway to remove that? Sorry if you put that in the new script, the "NULL" pop-up from the YEA Ace Battle Engine still appears so I assumed it hadn't been changed at all.
That would be the part I didn't check. Yanfly Battle Engine Compatibility.

So prevent the item from being selected if there are no tech points to recover.
OK, Except for the battle scene, this is working basically fine.

So I'll have to add yanfly battle engine and make it work with that.
But at first look, if the battle engine is above my script then it should not show the null message.
Just double checked, and yeah the message does seem not appear in battle. The issue is from the YEA Ace Battle Engine damage pop-ups. The NULL (no damage taken) pop-up is seemingly independent from the displayed message, so I assume that's what you'd need to look at. Additionally, because I'm making the tech point recovery item restore MP (functionally does nothing, just for a recovery pop-up) but that's offset if the "NULL" pop-up is also set to appear, whether there's actual text there or not, so ideally instead of just removing text from the pop-up, you could remove the pop-up entirely when using a tech point recovery item. Sorry to to ask you to incorperate a new script so late, but I REALLY appreciate your continued help. I look forward to any updates!
The issue is from the YEA Ace Battle Engine damage pop-ups.
I just realized that myself. That was not too hard to fix, I spent a lot of time trying to get everything else working for battles.
Test this and let me know if there are any issues.
Spoiler: Tech add on
Ruby:
# ╔═══════════════════════════════════════════════╦════════════════════╗
# ║ Title: Recover Tech Points Options            ║  Version: 1.05     ║
# ║ Author: Roninator2                            ║                    ║
# ╠═══════════════════════════════════════════════╬════════════════════╣
# ║ Function:                                     ║   Date Created     ║
# ║                                               ╠════════════════════╣
# ║   Provide additional methods of recovering    ║    05 Sep 2024     ║
# ╚═══════════════════════════════════════════════╩════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Requires: Victor Sant Base Module                                  ║
# ║           Victor Ssnt Tech Points                                  ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Brief Description:                                                 ║
# ║       Use item to recover tech points                              ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Instructions:                                                      ║
# ║   Use note tags on item when the item is designed to recover       ║
# ║   a specific amount of points on a specific skill                  ║
# ║      <TECH RECOVER> <- required                                    ║
# ║      <RECOVER TECH POINT: X> <- X equals the points to recover     ║
# ║                                                                    ║
# ║   Use the hp recover damage type and specify a formula             ║
# ║   Have the item set to use on 1 ally                               ║
# ║      b.restore_tech_points(X) <- X equals the points to recover    ║
# ║   A window to select the skill will pop up                         ║
# ║   Must be an item. Item is returned if no tech points given        ║
# ║                                                                    ║
# ║   To recover all points for skills with an actor use formula       ║
# ║      b.restore_all_techs                                           ║
# ║   Must be an item. Item is returned if no tech points given        ║
# ║                                                                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Updates:                                                           ║
# ║ 1.00 - 05 Sep 2024 - Script finished                               ║
# ║ 1.01 - 05 Sep 2024 - Updated for battles                           ║
# ║ 1.02 - 05 Sep 2024 - Stopped item consumption if tech is full      ║
# ║ 1.03 - 10 Sep 2024 - Fixed Battle usage of tech items              ║
# ║ 1.04 - 10 Sep 2024 - Fixed bugs                                    ║
# ║ 1.05 - 11 Sep 2024 - Fixed bad code                                ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Credits and Thanks:                                                ║
# ║   Roninator2                                                       ║
# ║                                                                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Terms of use:                                                      ║
# ║  Follow the original Authors terms of use where applicable         ║
# ║    - When not made by me (Roninator2)                              ║
# ║  Free for all uses in RPG Maker except nudity                      ║
# ║  Anyone using this script in their project before these terms      ║
# ║  were changed are allowed to use this script even if it conflicts  ║
# ║  with these new terms. New terms effective 03 Apr 2024             ║
# ║  No part of this code can be used with AI programs or tools        ║
# ║  Credit must be given                                              ║
# ╚════════════════════════════════════════════════════════════════════╝

# ╔════════════════════════════════════════════════════════════════════╗
# ║                      End of editable region                        ║
# ╚════════════════════════════════════════════════════════════════════╝

#==============================================================================
# ** RPG::UsableItem
#------------------------------------------------------------------------------
#  This is the superclass for skills and items.
#==============================================================================

class RPG::UsableItem < RPG::BaseItem
  #--------------------------------------------------------------------------
  # * New method: recover_tech_points
  #--------------------------------------------------------------------------
  def recover_tech_points
    regexp = /<RECOVER TECH POINT: (\d+)>/i
    note.scan(regexp).collect { {value: $1.to_i} }
  end
  #--------------------------------------------------------------------------
  # * New method: is_tech_recover?
  #--------------------------------------------------------------------------
  def is_tech_recover?
    note =~ /<TECH RECOVER>/i ? true : false
  end
end

#==============================================================================
# ** Game_BattlerBase
#------------------------------------------------------------------------------
#  This class handles battlers. It's used as a superclass of the Game_Battler
# classes.
#==============================================================================

class Game_BattlerBase
  #--------------------------------------------------------------------------
  # * New method: draw_tech_points_cost
  #--------------------------------------------------------------------------
  def skill_tech_points?(skill)
    return true if get_all_notes =~ /<INFINITE TECH POINTS>/i
    return true if self.is_a?(Game_Enemy)
    setup_tech(skill.id) if !@tech_skills[skill.id]
    @tech_skills[skill.id][:now] > 0
  end
  #--------------------------------------------------------------------------
  # new method: make_miss_popups
  #--------------------------------------------------------------------------
  alias r2_make_popup_block_tech_item   make_miss_popups
  def make_miss_popups(user, item)
    if item.damage.formula.include?("restore_tech_points") ||
       item.damage.formula.include?("restore_all_techs") ||
       item.is_tech_recover?
      return
    end
    r2_make_popup_block_tech_item(user, item)
  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
  #--------------------------------------------------------------------------
  # * New method: restore_tech_points
  #--------------------------------------------------------------------------
  def restore_tech_points(value)
    imp = false
    item = $game_party.last_item.object
    @equip_skills.each {|id| 
      next if id == 0
      sk = $data_skills[id]
      next if !sk.is_tech_skill?
      setup_tech(id) if !@tech_skills[id]
      next if tech_point(id) == tech_max(id)
      @tech_skills[id][:now] += value
      @tech_skills[id][:now] == @tech_skills[id][:max] if @tech_skills[id][:now] > @tech_skills[id][:max]
      refresh_tech(id)
      imp = true
    }
    if imp == false
      $game_party.gain_item(item, 1)
      Sound.play_buzzer
    end
  end
  #--------------------------------------------------------------------------
  # * New method: restore_all_techs
  #--------------------------------------------------------------------------
  def restore_all_techs
    imp = false
    item = $game_party.last_item.object
    @skills.each {|id| 
      next if id == 0
      sk = $data_skills[id]
      next if !sk.is_tech_skill?
      setup_tech(id) if !@tech_skills[id]
      next if tech_point(id) == tech_max(id)
      @tech_skills[id][:now] = @tech_skills[id][:max]
      refresh_tech(id)
      imp = true
    }
    if imp == false
      $game_party.gain_item(item, 1)
      Sound.play_buzzer
    end
  end
end

#==============================================================================
# ¡ Window_SkillList_Item
#==============================================================================

class Window_SkillList_Item < Window_SkillList
  
  #--------------------------------------------------------------------------
  # initialize
  #--------------------------------------------------------------------------
  def initialize(x, y, width, height)
    super
    self.hide
    self.index = 0
    select(-1)
  end
  #--------------------------------------------------------------------------
  # col_max
  #--------------------------------------------------------------------------
  def col_max
    return 1
  end
  #--------------------------------------------------------------------------
  # enable?
  #--------------------------------------------------------------------------
  def enable?(item)
    @actor
  end
  #--------------------------------------------------------------------------
  # include?
  #--------------------------------------------------------------------------
  def include?(item)
    item
  end
  #--------------------------------------------------------------------------
  # make_item_list
  #--------------------------------------------------------------------------
  def make_item_list
    super
    @data = @data.select{|s| s.is_tech_skill?}
  end
  #--------------------------------------------------------------------------
  # draw_item
  #--------------------------------------------------------------------------
  def draw_item(index)
    draw_text(0, 0, self.width-24, 24, @actor.name, 2)
    skill = @data[index]
    rect = item_rect(index)
    rect.width -= 4
    rect.y += line_height
    draw_item_name(skill, rect.x, rect.y, enable?(skill))
  end
  #--------------------------------------------------------------------------
  # * Update Cursor
  #--------------------------------------------------------------------------
  alias r2_cursor_pos_down  update_cursor
  def update_cursor
    r2_cursor_pos_down
    cursor_rect.y += line_height
  end
  #--------------------------------------------------------------------------
  # * Processing When OK Button Is Pressed
  #--------------------------------------------------------------------------
  def process_ok
    if @index < 0
      select_last
      return
    end
    call_ok_handler
  end
  #--------------------------------------------------------------------------
  # * Restore Previous Selection Position
  #--------------------------------------------------------------------------
  def select_last
    select(0)
  end
  #--------------------------------------------------------------------------
  # * Restore Previous Selection Position
  #--------------------------------------------------------------------------
  def actor(act)
    @actor = act
  end
end

#==============================================================================
# ** Scene_Item
#------------------------------------------------------------------------------
#  This class performs the item screen processing.
#==============================================================================

class Scene_Item < Scene_ItemBase
  
  #--------------------------------------------------------------------------
  # alias method: start
  #--------------------------------------------------------------------------
  alias r2_skill_equip_start start
  def start
    r2_skill_equip_start
    create_skill_equip_window
  end
  
  #--------------------------------------------------------------------------
  # new method: create_skill_equip_window
  #--------------------------------------------------------------------------
  def create_skill_equip_window
    wx = 0
    wy = 100
    ww = Graphics.width / 2
    wh = Graphics.height - wy
    @skill_recover = Window_SkillList_Item.new(wx, wy, ww, wh)
    @skill_recover.z = 1000
    @skill_recover.actor = @actor
    @skill_recover.set_handler(:ok, method(:on_skill_item_ok))
    @skill_recover.set_handler(:cancel, method(:on_skill_item_cancel))
    @skill_recover.deactivate.hide
  end

  #--------------------------------------------------------------------------
  # new method: on_skill_equip_ok
  #--------------------------------------------------------------------------
  def on_skill_item_ok
    return if @skill_recover.item == nil
    id = @skill_recover.item.id
    value = item.recover_tech_points[0][:value]
    Sound.play_buzzer if @actor.tech_point(id) == @actor.tech_max(id)
    return if @actor.tech_point(id) == @actor.tech_max(id)
    @actor.change_tech_points(id, value)
    r2_item_skill_tech_recover
    if !$game_party.has_item?(item)
      @skill_recover.deactivate.hide
      on_actor_cancel
    end
  end
  
  #--------------------------------------------------------------------------
  # new method: on_skill_equip_cancel
  #--------------------------------------------------------------------------
  def on_skill_item_cancel
    @skill_recover.deactivate.hide
    @actor_window.activate
    @skill_recover.actor(nil)
    @skill_recover.select(-1)
  end
  
  #--------------------------------------------------------------------------
  # * Use Item
  #--------------------------------------------------------------------------
  alias r2_item_skill_tech_recover  use_item
  def use_item
    @actor = $game_party.members[@actor_window.index]
    if item.is_tech_recover? && item.recover_tech_points[0]
      $game_party.last_item.object = item
      @actor_window.deactivate
      @skill_recover.actor(@actor)
      @skill_recover.refresh
      @skill_recover.activate.show
    elsif item.damage.formula.include?("restore_tech_points") ||
        item.damage.formula.include?("restore_all_techs")
      if !actor_tech_rec(item, @actor_window.index)
        Sound.play_buzzer
        @actor_window.activate
        return
      end
      r2_item_skill_tech_recover
    else
      r2_item_skill_tech_recover
    end
  end
  
  #--------------------------------------------------------------------------
  # * Actor [OK]
  #--------------------------------------------------------------------------
  def actor_tech_rec(item, index)
    actor = $game_party.members[index]
    can_use = false
    actor.equip_skills.each { |sk|
      can_use = true if actor.tech_point(sk) < actor.tech_max(sk)
    }
    return can_use
  end

end

#==============================================================================
# ** Window_BattleActor
#------------------------------------------------------------------------------
#  This window is for selecting an actor's action target on the battle screen.
#==============================================================================

class Window_BattleActor < Window_BattleStatus
  #--------------------------------------------------------------------------
  # current_item_enabled?
  #--------------------------------------------------------------------------
  def current_item_enabled?
    @item = BattleManager.actor.actions[0].item
    if @item.is_a?(RPG::Item) && @item.is_tech_recover?
      actor = $game_party.battle_members[@index]
      can_use = false
      actor.equip_skills.each { |sk|
        can_use = true if actor.tech_point(sk) < actor.tech_max(sk)
      }
      return true if actor && can_use
    else
      super
    end
  end
end

#==============================================================================
# ¡ Window_BattleList_Item
#==============================================================================

class Window_BattleList_Item < Window_SkillList
  
  #--------------------------------------------------------------------------
  # initialize
  #--------------------------------------------------------------------------
  def initialize(x, y, width, height)
    super
    self.hide
    self.index = 0
    select(-1)
  end
  #--------------------------------------------------------------------------
  # col_max
  #--------------------------------------------------------------------------
  def col_max
    return 1
  end
  #--------------------------------------------------------------------------
  # enable?
  #--------------------------------------------------------------------------
  def enable?(item)
    @actor
  end
  #--------------------------------------------------------------------------
  # include?
  #--------------------------------------------------------------------------
  def include?(item)
    item
  end
  #--------------------------------------------------------------------------
  # make_item_list
  #--------------------------------------------------------------------------
  def make_item_list
    super
    @data = @data.select{|s| s.is_tech_skill?}
  end
  #--------------------------------------------------------------------------
  # draw_item
  #--------------------------------------------------------------------------
  def draw_item(index)
    draw_text(0, 0, self.width-24, 24, @subject.name, 0)
    draw_text(0, 0, self.width-24, 24, "->", 1)
    draw_text(0, 0, self.width-24, 24, @actor.name, 2)
    skill = @data[index]
    rect = item_rect(index)
    rect.width -= 4
    rect.y += line_height
    draw_item_name(skill, rect.x, rect.y, enable?(skill))
  end
  #--------------------------------------------------------------------------
  # * Update Cursor
  #--------------------------------------------------------------------------
  alias r2_cursor_pos_down  update_cursor
  def update_cursor
    r2_cursor_pos_down
    cursor_rect.y += line_height
  end
  #--------------------------------------------------------------------------
  # * Processing When OK Button Is Pressed
  #--------------------------------------------------------------------------
  def process_ok
    if @index < 0
      select_last
      return
    end
    call_ok_handler
  end
  #--------------------------------------------------------------------------
  # * Restore Previous Selection Position
  #--------------------------------------------------------------------------
  def select_last
    select(0)
  end
  #--------------------------------------------------------------------------
  # * Restore Previous Selection Position
  #--------------------------------------------------------------------------
  def actor(act)
    @actor = act
  end
  #--------------------------------------------------------------------------
  # * Restore Previous Selection Position
  #--------------------------------------------------------------------------
  def subject(act)
    @subject = act
  end
end

#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
#  This class performs battle screen processing.
#==============================================================================

class Scene_Battle < Scene_Base
  attr_accessor :item_tech_track
  #--------------------------------------------------------------------------
  # * Create All Windows
  #--------------------------------------------------------------------------
  alias r2_skill_battle_equip_create_windows  create_all_windows
  def create_all_windows
    r2_skill_battle_equip_create_windows
    create_skill_equip_window
    @item_tech_track = []
  end
  
  #--------------------------------------------------------------------------
  # new method: create_skill_equip_window
  #--------------------------------------------------------------------------
  def create_skill_equip_window
    wx = 0
    wy = 100
    ww = Graphics.width / 2
    wh = Graphics.height - wy
    @skill_recover = Window_BattleList_Item.new(wx, wy, ww, wh)
    @skill_recover.z = 1000
    @skill_recover.actor = @actor
    @skill_recover.set_handler(:ok, method(:on_skill_item_ok))
    @skill_recover.set_handler(:cancel, method(:on_skill_item_cancel))
    @skill_recover.deactivate.hide
  end

  #--------------------------------------------------------------------------
  # new method: on_skill_equip_ok
  #--------------------------------------------------------------------------
  def on_skill_item_ok
    id = @skill_recover.item.id
    item = @subject.actions[0].item
    value = item.recover_tech_points[0][:value]
    Sound.play_buzzer if @actor.tech_point(id) == @actor.tech_max(id)
    return if @actor.tech_point(id) == @actor.tech_max(id)
    @actor.change_tech_points(id, value)
    @skill_recover.deactivate.hide
    r2_actor_skill_recover_item
  end
  
  #--------------------------------------------------------------------------
  # new method: on_skill_equip_cancel
  #--------------------------------------------------------------------------
  def on_skill_item_cancel
    @skill_recover.deactivate.hide
  end
  
  #--------------------------------------------------------------------------
  # * Actor [OK]
  #--------------------------------------------------------------------------
  alias r2_on_item_actor_recover_tech_ok    on_actor_ok
  def on_actor_ok
    item = @item_window.item
    skill = @skill_window.item
    last = BattleManager.actor.actions[0].item
    if item.is_a?(RPG::Item) && item.is_tech_recover? && item.recover_tech_points[0] && 
      item.recover_tech_points[0][:value] > 0 && item == last
      if !actor_tech_rec(item, @actor_window.index)
        select_actor_selection
        return
      end
      @item_tech_track.push([item, @actor_window.index])
    end
    if item.is_a?(RPG::Item) && item.is_tech_recover? && item.damage.formula.include?("restore_tech_points") && 
      item == last
      if !actor_tech_rec(item, @actor_window.index)
        select_actor_selection
        return
      end
    end
    if item.is_a?(RPG::Item) && item.is_tech_recover? && item.damage.formula.include?("restore_all_techs") && 
      item == last
      if !actor_tech_rec(item, @actor_window.index)
        select_actor_selection
        return
      end
    end
    r2_on_item_actor_recover_tech_ok
  end
  
  #--------------------------------------------------------------------------
  # * Actor [OK]
  #--------------------------------------------------------------------------
  def actor_tech_rec(item, index)
    actor = $game_party.members[index]
    can_use = false
    actor.equip_skills.each { |sk|
      can_use = true if actor.tech_point(sk) < actor.tech_max(sk)
    }
    return can_use
  end
  
  #--------------------------------------------------------------------------
  # * Use Skill/Item
  #--------------------------------------------------------------------------
  alias r2_actor_skill_recover_item  use_item
  def use_item
    item = @subject.current_action.item
    i = 0; ind = 0; @actor = nil
    if item.is_tech_recover? && item.recover_tech_points[0]
      @item_tech_track.each { |lit|
        @actor = $game_party.members[lit[1]] if lit[0] == item 
        ind = i if lit[0] == item 
        i += 1
      }
      @actor_window.deactivate
      @skill_recover.actor(@actor)
      @skill_recover.subject(@subject)
      @skill_recover.refresh
      @skill_recover.activate.show
      @skill_recover.select_last
      update_for_wait while @skill_recover.active
    elsif item.damage.formula.include?("restore_tech_points") ||
        item.damage.formula.include?("restore_all_techs")
      if !actor_tech_rec(item, @actor_window.index)
        Sound.play_buzzer
        @actor_window.activate
        return
      end
      r2_actor_skill_recover_item
    else
      r2_actor_skill_recover_item
    end
  end
  
  #--------------------------------------------------------------------------
  # * Start Party Command Selection
  #--------------------------------------------------------------------------
  alias r2_party_select_reset_tech  start_party_command_selection
  def start_party_command_selection
    @item_tech_track = []
    r2_party_select_reset_tech
  end
  
end

class Window_BattleLog < Window_Selectable
  #--------------------------------------------------------------------------
  # * Display HP Damage
  #--------------------------------------------------------------------------
  alias r2_display_hp_damage_return display_hp_damage
  def display_hp_damage(target, item)
    if item.damage.formula.include?("restore_tech_points") ||
       item.damage.formula.include?("restore_all_techs") ||
       item.is_tech_recover?
      return
    end
    r2_display_hp_damage_return(target, item)
  end
  #--------------------------------------------------------------------------
  # * Display Failure
  #--------------------------------------------------------------------------
  alias r2_display_failure_return   display_failure
  def display_failure(target, item)
    if item.damage.formula.include?("restore_tech_points") ||
       item.damage.formula.include?("restore_all_techs") ||
       item.is_tech_recover?
      return
    end
    r2_display_failure_return(target, item)
  end
end

Please note that all tech recover items need the <TECH RECOVER> note tag now.
Thanks for the script update! Unfortunately, I encountered a bug pretty quickly. When I opened the item menu, the game crashed.

Spoiler: Item Menu Crash
1726013669013.png

However, the item works perfectly in combat! A buzzer sound over the normal selection sound would be prefered, but this works perfectly fine. Thank you! I'll try to also figure out this crash on my own, and see if it was my fault.
I encountered a bug pretty quickly
Thanks. Added some more code to get those bugs out.
Thank you so much for all of your help!!! This new script is perfect! This should be everything I need for my combat system. I'll keep in touch in case I run into any bugs or need any adjustments. Again, thank you SO much for your constant help and patience!
Thank you so much for all of your help!!! This new script is perfect! This should be everything I need for my combat system. I'll keep in touch in case I run into any bugs or need any adjustments. Again, thank you SO much for your constant help and patience!
Looks like I made some more dumb errors. I had a feeling it wasn't good. Tested it and there were issues. I updated the code above.
Now all my tests worked except I did notice a glitch where selecting to use an item on a player did not get used.
If you have the same issue, let me know.

Original thread: https://forums.rpgmakerweb.com/threads/vx-ace-displaying-certain-values-text-in-yamis-skill-equip.171649/