
Formulas that I have tried:
[[{{floor(@{casterlevel}/2),5}dh1}d4]] (returns Undefined)
[[{{@{casterlevel}/2,5}dh1}d4]] (returns Undefined)
[[({floor(@{casterlevel}/2),5}dh1)d4]] (returns #dice does not roll) ex: [[({floor(10/2),5}dh1)d4]] returns 5
[[({@{casterlevel}/2,5}dh1)d4]] (returns #dice does not roll) ex: [[({10/2,5}dh1)d4]] returns 5
[[((@{casterlevel}-1)/2)d4]] (rolls correctly but does not cap #dice)
I have read the dice reference article on order of operations and have sense learned that the floor() function resolves at the end of the expression and as such cannot be used in this sort of formula
I believe that the dh1 function likely also can't be used in this formula either since [[((@{casterlevel}-1)/2)d4]] works but lacks the caster level cap for the spell
so is there any other way to accomplish this?