I need a little help with a probability calculation in anydice. We make a fudge based game using 4 fudge dice, so basically a d3 system: -1,0,1

We allow your attribute or stats in the game to go from -3 to 4 and high stats allow you to roll back a die.

So, basically, on any fudge roll, a character can roll back a maximum number of dice. If he has a negative statistic, he must withdraw the dice from the initial roll.

I figured out how to determine the probabilities of throwing with 4 dice and less, which is a negative statistic:

```
output 4d{-1,0,1}
```

What I need help is to determine the probability of raising a die when a character has a positive statistic.

An example of what I'm talking about: My fighter has a 1 and I roll my 4 dice to the fudge, I get 3 whites and 1 – on the dice.

I decide to raise the 1 – to try to get a better result in the second throw.

A formula that I have tried in any dice to represent the example above is `4d{-1,0,1}-1`

The problem with this forum is that it only works if the second raise is better, it is possible that the second raise is the same, so that it does not quite work.

Does anyone have any idea of how I can create an appropriate formula in anydice to represent a 4 dice dungeon raise with the possibility of a 1 to 4 dice raise and the possibility that the second raise only has a 66% chance to be better than the first raise.

I assume that players will only roll back the dice if they see a negative result on the fudge dice.