Hello! I have figured out everything for my homebrew character sheets except for the automatic rolling. I want to make it easier for my players but figuring this out is making me want to pull my hair out. I have been going through other sheet code and the wiki and still cant understand the process and cant make it fit with my game.  Below is one of the weapon blocks for my character sheet. The mechanics for my game are a bit different than D&D. Roll for attack is 5d4+(ability score)d4. I am trying to figure out how to auto calculate a critical hit and critical damage in an attack roll. The critical hit is 3/4 of the total number available to roll to hit. So if your using strength with a score of 3: 5d4+3d4. And a critical hit would be calculated for sums 24 and above.  I am also trying to understand how to add in to my character sheet  Advantage | Always | Disadvantage | Never toggles. Pretty much pulling my hair out trying to figure out the last two major pieces to my character sheet. Any help is much appreciated.  <div class='sheet-col'>         <h4 style="width:98%">Left Hand</h4>             <table class="sheet-center" style="width:100%">                 <tr>                     <td class="sheet-thin">Attack</td>                     <td class="sheet-thin">Crit</td>                     <td class="sheet-thin">Weapon</td>                     <td class="sheet-thin">Damage Type</td>                 </tr>                 <tr>                     <td><button type='roll' class="sheet-skill_button" name="attr_weapon_roll-left" value="&{template:attack} {{name=@{weapon_name-left}}} {{type=@{weapon_type-left}}} {{attack= [[5d4+@{weapon_select-left}d4]]}} {{damage= [[@{weapon_number_dice-left}@{weapon_damage_die-left}+@{weapon_select-left}@{weapon_damage_die-left}]]}} "></button></td>                     <td><button type='roll' class="sheet-skill_button" name="attr_critdamage_roll-left" value="&{template:skill} {{name=@{weapon_name-left} Critical Hit}} {{skill= [[@{weapon_select-left}@{weapon_damage_die-left}]]}}"></button></td>                     <td><input type="text" class="sheet-number" style="width: 100px" name="attr_weapon_name-left" /></td>                     <td><input type="text" class="sheet-number" style="width: 100px" name="attr_weapon_type-left" /></td>                 </tr>                 <tr>                     <td class="sheet-thin">Skill</td>                     <td class="sheet-thin">Damage Dice</td>                     <td class="sheet-thin">Number of Dice</td>                     <td class="sheet-thin">Damage Bonus</td>                 </tr>                 <tr>                     <td><select class ="sheet-select" style="width:75px" name="attr_weapon_select-left" value="0" >                         <option value="@{strength}">Strength</option>                         <option value="@{dexterity}">Dexterity</option>                         <option value="@{wisdom}">Wisdom</option>                         </select>                     </td>                     <td><select class ="sheet-select" name="attr_weapon_damage_die-left" value="0" style="width:60px">                         <option value='d4'>d4</option>                         <option value='d6'>d6</option>                         <option value='d8'>d8</option>                         <option value='d10'>d10</option>                         <option value='d12'>d12</option>                         </select>                     </td>                     <td><input type="number" class="sheet-number" name="attr_weapon_number_dice-left" /></td>                     <td><input type="number" class="sheet-number" name="attr_weapon_damage_bonus-left" value="@{weapon_select-left}" disabled="true" /></td>                 </tr>                 <tr>                     <td class="sheet-thin">Range</td>                     <td class="sheet-thin">Ammo Type</td>                     <td class="sheet-thin">Ammo Count</td>                     <td class="sheet-thin">Crit</td>                 </tr>                 <tr>                     <td><input type="text" class="sheet-number" style="width:75px" name="attr_weapon_range-left" /></td>                     <td><input type="text" class="sheet-number" style="width:75px" name="attr_weapon_ammo-left" /></td>                     <td><input type="text" class="sheet-number" style="width:75px" name="attr_weapon_ammo_count-left" /></td>                     <td><input type="number" class="sheet-number" name="attr_weaponcrit-left" placeholder="75%ATKmax" value="" /></td>                 </tr>                 <tr>                     <td>Speed</td>                     <td><select class ="sheet-select" style="width:75px" name="attr_weapon_speed-left" value="0" >                         <option value="1">Fast</option>                         <option value="2">Regular</option>                         <option value="3">Slow</option>                     </td>                     <td>Condition</td>                     <td colspan="2">                         <input type="checkbox" name="attr_condition_1-left" value="1" class="sheet-bigcheck"/><span></span>                         <input type="checkbox" name="attr_condition_2-left" value="1" class="sheet-bigcheck"/><span></span>                         <input type="checkbox" name="attr_condition_3-left" value="1" class="sheet-bigcheck"/><span></span>                         <input type="checkbox" name="attr_condition_4-left" value="1" class="sheet-bigcheck"/><span></span>                         <input type="checkbox" name="attr_condition_5-left" value="1" class="sheet-bigcheck"/><span></span>                     </td>                 </tr>             </table>         </div>