Two variables:
%NPCTERMS - Used to keep track of if you're on good terms with the person. You can name it whatever you want.
%HANDSTATUS - Used to keep track of your hand.
The random chance of failure bit would have to be done with scripting. Here, it's done by "rolling dice".
%DICEROLL := 1d6
In the above line, I'm setting the variable "DICEROLL" to be the result of 1d6. 1d6 means 1 dice with 6 sides rolled. This would give me a value between 1 and 6.
2d8 = 2 eight-sided dice rolled, giving me a result between 2 and 16
7d3 = 7 three-sided dice rolled, giving me a result between 7 and 21
I think you get the idea by now for the random chance of failure part. The actual code would look something like:
%DICEROLL := 1d6
IF %DICEROLL > 4 THEN
%HANDSTATUS := 0
ELSE
%HANDSTATUS := 1
So if the dice rolls greater than 4 (5 or 6), the hand is fixed (set to 0), otherwise it remains injured (set to 1).