Hi, I am creating a new character sheet for a new TTRPG. I started a few days ago and I am trying to figure out how to correctly get the skill dice roll result I want. The roll is calculated this way: [Skill Dice Pool] - [Negative Modifier] d6 > 4 But players can have focuses. For example, skill crafting, focus blacksmithing. It isn't a flat bonus, but if you failed (rolled 3 or under) in any of the dice you can replace up to 2 of them with a success. Example: Dice pool of 5 (skill dice pool 7 and negative modifier 2 for example): (1, 5, 3, 6, 4), so 3 successes.+1 focus applies in this case so the result is 4 successes Example 2: Dice pool of 5: (5, 5, 6, 4, 5), so 5 successes. Since no dice failed, +1 focus cannot be applied and the result is 5 successes. So my question is: What would be the best way of coding that into the character sheet? What I did so far: < button type = "roll" name = "roll_crafting" value = "&{template:testtemplate} {{name=Crafting}} {{roll=[[(@{crafting-dice-pool} -@{negative-modifier})d6>4 + ?{Focus|0} ]]}}" ></ button > I can't do it this way. I would like the player to be able to input his own focus number, but the above code is going to add that number every time, regardless of the maximum number of successes. I thought I could use a custom roll function. < button type = "action" name = "act_roll_crafting" > Roll </ button > but that would require me to create a sheet worker on button click event for each skill. I need to set a few variables for the roll template, such as the name of the skill and the skill dice pool (the negative modifier would be the same for all skills so I could just get that value easily) These are my questions: Is there a way to avoid using the action button? Can I somehow code the standard roll macro to achieve what I want? If I need to use the action button, how can I pass parameters such as skill name and base dice pool - so I can use the same roll function for all of the skills to avoid code repetition? --- I could create a function for every button and those parameters would be defined in that function, and then passed into another function, the roll function, to reuse a big chunk of the code, but it still seems a bit excessive to have a separate on click event for every button. Is that really the best solution? Is there another solution I did not think of?