A separate inventory for game and for battle

I'm trying to do something different in this RPG. First of all you can only use items in battle. The number of items you have indicate how many times you can use them during a single battle. When the battle is over, that number of items is replenished.

Ex:
You have 3 potions
You start a battle, you use 2 potions (after that, the item menu will say you have 1 potion)
Battle is over, you have 3 potions again on the next one

So basically I need a copy of the party's inventory (only for usables) and whenever a battle starts, it copies the items from the normal inventory.

I know only a little bit of scripting so I'm not too sure how to do this. I know items are stored in the item_container function in Game_Party and basically how items are added and used/removed, but I wouldn't know how to do this without adding a complete copy of Scene_Item. Maybe changes to Window_BattleItem is the way to go?

Any help is appreciated ^^
Interesting concept I'd say
Code:
#==============================================================================
# TheoAllen - Separate Battle Item
# Version : -
#------------------------------------------------------------------------------
# You have 3 pots, you go to battle, used up all pots. But you got back 3 pots
# after the battle ended. Because who cares about buying pots in shop anyway
#==============================================================================
class Game_Party 
 
  alias theo_battle_items_init initialize
  def initialize
    theo_battle_items_init
    @battle_items = []
  end
 
  def duplicate_items
    @battle_items = @items.clone
  end
 
  alias theo_battle_items_container item_container
  def item_container(item_class)
    return @battle_items if item_class == RPG::Item && in_battle
    return theo_battle_items_container(item_class)
  end
 
  def battle_items
    @battle_items.keys.sort.collect {|id| $data_items[id] }
  end
 
end

class Window_BattleItem
  def make_item_list
    @data = $game_party.battle_items.select {|item| include?(item) }
    @data.push(nil) if include?(nil)
  end
end

class Scene_Battle
  alias theo_battle_items_start start
  def start
    $game_party.duplicate_items
    theo_battle_items_start
  end
end
@TheoAllen Seems to work! I'm lucky you're back 👋

Original thread: https://forums.rpgmakerweb.com/threads/a-separate-inventory-for-game-and-for-battle.87057/