Is there a way to do Scripts inside Battles?

So I ahve this player Character wearing a One use Item. Its a super defense and is there to block the bad guys 2K attack in the rare instance that the characters attack does not kill him in the scripted battle. Can that be done?

Basically I want it to be

IF attacked USE Item A
IF Item A Use = True Print Txt "Damn that was Close!" PRINT "Ring of Absorption Destroyed"

Then after the battle is over

IF Item A Use =true THEN Removed Item A from Inventory
Print Text = "So and so is gonna be upset. That was her family treasure."

IF Item A Use = False THEN Print Txt "I better get this back to So and so"

I am slowly remembering my jabascript and coding which is good but I am still not sure how to run a script during a battle.

The Only reason I am doing this is the Mega Boss Killing attack can sometimes Miss it's shot and I don;t want the PC to be higher than the rest of the PC as he will be a part of the party during the adventuring part of the game so Im trying to do this Scrpted boss battle using once use Items that break during the battle. The "Ultima Cannon" Just breaks and is removed after battle signifying it's one shot is gone, but I want the Ring to be an either or situation.

Original thread: https://forums.rpgmakerweb.com/threads/is-there-a-way-to-do-scripts-inside-battles.112535/