min(actual,cap)d10 can be written as [[ [[{actual,cap}kl1]]d10 ]]. If your "actual" is a die roll, it would be something like this: [[ [[{3d6,0d0+10}kl1]]d10 ]] If your "actual" is a static number (stored in an attribute, say), then this should work: [[ [[{@{selected|StaticNumberAttr},10}kl1]]d10 ]] AFAIK, kl1 needs two values of the same type (so rolls vs rolls or static vs static), hence the 0d0+10 in the first example. Not sure what the modulo part is doing, but assuming you need that as well, I think this should do it (using the 3d6 example): [[ [[ [[{3d6,0d0+10}kl1]]d10 ]] + [[[[3d6]]%10*5]] ]] You could prove it to yourself with this: &{template:default} {{name=Max 10 dice}} [[ [[ [[{3d6,0d0+10}kl1]]d10 ]] + [[[[3d6]]%10*5]] ]] {{Total=$[[4]]}} {{num d10's=$[[0]]}} {{min(actual,cap)d10=$[[1]]}} {{"actual" 3d6=$[[2]]}} {{modulo part=$[[3]]}}