How do i make an item ban/restriction to battles?

Hey, I am currently making a side mode. Where is just endless battles untill the player loses.
And i want to add a item restriction so players cant just spam items to survive.
I have tried searching but only found results for MV. Is there a way to make a item restriction that can only effect some battles and not every battle?
So, not entirely sure, but I think what you could do is get the amount of an item a plater has, store it in a variable, remove all the items, do the battle, and then give them the items back using the variable.
Can you clarify - are you trying to take away one or more specific items, as @TRIDIUM suggests?

Or are you looking to disable the entire Item command?
Can you clarify - are you trying to take away one or more specific items, as @TRIDIUM suggests?

Or are you looking to disable the entire Item command?
Im trying to disable the item command.
These might help.
Thanks for helping me with this. i hope you two have a great day.
If you just need to disable the Item command, you don't need any overly complex script but just this scriptlet:

Ruby:
class Window_ActorCommand
  ENABLE_ITEMS_SWITCH = 100
  def add_item_command
    add_command(Vocab::item, :item, $game_switches[ENABLE_ITEMS_SWITCH])
  end
end

So if the game switch #100 is ON, the player will be able to use items. Otherwise the player will get a buzzer sound in return.

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-make-an-item-ban-restriction-to-battles.164404/