Widget:HealCalculator

function calculate { var HP = document.getElementById('HP').value; var STR = document.getElementById('STR').value; var PTNCY = document.getElementById('PTNCY').value / 100; var PTNCYB = document.getElementById('PTNCYB').value / 100; var STRB = document.getElementById('STRB').value / 100 + 1; var SCOBUFF = document.getElementById("Strength coAbility")[document.getElementById("Strength coAbility").selectedIndex].value / 100 + 1; var HCOBUFF = document.getElementById("Healing coAbility")[document.getElementById("Healing coAbility").selectedIndex].value / 100 + 1; if (document.getElementById('ELEM').checked) { var EBUFF = 1.2; } else { var EBUFF = 1; }     if (document.getElementById('RAID').checked) { var TARG = 16; } else { var TARG = 4; }     if (checkbox.checked) { var DUR = document.getElementById('DUR').value; var FREQ = document.getElementById('FREQ').value; var REGEN = document.getElementById('REGEN').value / 100; var TIMES = Math.floor(DUR/FREQ); var RTOTAL = (((0.64*HP + 0.24*(STR * STRB * SCOBUFF)) * REGEN * (PTNCYB + HCOBUFF)) / TARG) * EBUFF * TIMES; var TOTAL = (((0.64*HP + 0.24*(STR * STRB * SCOBUFF)) * PTNCY * (PTNCYB + HCOBUFF)) / TARG) * EBUFF + RTOTAL; } else { var TOTAL = (((0.64*HP + 0.24*(STR * STRB * SCOBUFF)) * PTNCY * (PTNCYB + HCOBUFF)) / TARG) * EBUFF; }     var MINRANGETOTAL = TOTAL*.95; var MAXRANGETOTAL = TOTAL*1.05; document.getElementById("total").innerHTML = Math.floor(MINRANGETOTAL) + "-" + Math.floor(MAXRANGETOTAL); console.log(RTOTAL); }   function display { var hot = document.getElementById("HOT"); if (document.getElementById('checkbox').checked) { hot.style.display = "block"; } else { hot.style.display = "none"; }   }     HP         STR    Potency %    Potency Buff %    Active Strength Buff %    Healing CoAbility % <div class="dd-description" style="display:inline-block;width:150px;text-align:left;padding: 3px 0 3px 6px;border-left: 1px #528e52 solid;vertical-align:top"> <select id="Healing coAbility" name="Healing coAbility"> Recovery Potency +0% Recovery Potency +2% Recovery Potency +4% Recovery Potency +6% Recovery Potency +8% Recovery Potency +10% Recovery Potency +12% Recovery Potency +14% Recovery Potency +16% Recovery Potency +20% <div class="dt-term" style="display:inline-block;width:120px;text-align:right;padding: 3px 8px 3px 0;margin: 0 -6px 0 0;border-right:3px #528e52 solid;font-weight:bold;vertical-align:top"> Strength CoAbility % <div class="dd-description" style="display:inline-block;width:150px;text-align:left;padding: 3px 0 3px 6px;border-left: 1px #528e52 solid;vertical-align:top"> <select id="Strength coAbility" name="Strength coAbility"> Strength +0% Strength +1% Strength +2% Strength +3% Strength +4% Strength +5% Strength +6% Strength +7% Strength +8% Strength +10% <div class="dt-term" style="display:inline-block;width:120px;text-align:right;padding: 3px 8px 3px 0;margin: 0 -6px 0 0;border-right:3px #528e52 solid;font-weight:bold;vertical-align:top"> Same Element? <div class="dd-description" style="display:inline-block;width:150px;text-align:left;padding: 3px 0 3px 6px;border-left: 1px #528e52 solid;vertical-align:top"> <input type="checkbox" id="ELEM">Check for yes. <div class="dt-term" style="display:inline-block;width:120px;text-align:right;padding: 3px 8px 3px 0;margin: 0 -6px 0 0;border-right:3px #528e52 solid;font-weight:bold;vertical-align:top"> Raid? <div class="dd-description" style="display:inline-block;width:150px;text-align:left;padding: 3px 0 3px 6px;border-left: 1px #528e52 solid;vertical-align:top"> <input type= "checkbox" id="RAID">Check for yes. <div class="dt-term" style="display:inline-block;width:120px;text-align:right;padding: 3px 8px 3px 0;margin: 0 -6px 0 0;border-right:3px #528e52 solid;font-weight:bold;vertical-align:top"> Include Healing Over Time? <div class="dd-description" style="display:inline-block;width:150px;text-align:left;padding: 3px 0 3px 6px;border-left: 1px #528e52 solid;vertical-align:top"> <input type="checkbox" id="checkbox" onclick="display">Check for yes. <div class="dt-term" style="display:inline-block;width:120px;text-align:right;padding: 3px 8px 3px 0;margin: 0 -6px 0 0;border-right:3px #528e52 solid;font-weight:bold;vertical-align:top"> REGEN% <div class="dd-description" style="display:inline-block;width:150px;text-align:left;padding: 3px 0 3px 6px;border-left: 1px #528e52 solid;vertical-align:top"> <input type="number" id="REGEN" class="a"> <div class="dt-term" style="display:inline-block;width:120px;text-align:right;padding: 3px 8px 3px 0;margin: 0 -6px 0 0;border-right:3px #528e52 solid;font-weight:bold;vertical-align:top"> DURATION <div class="dd-description" style="display:inline-block;width:150px;text-align:left;padding: 3px 0 3px 6px;border-left: 1px #528e52 solid;vertical-align:top"> <input type="number" id="DUR" class="a"> <div class="dt-term" style="display:inline-block;width:120px;text-align:right;padding: 3px 8px 3px 0;margin: 0 -6px 0 0;border-right:3px #528e52 solid;font-weight:bold;vertical-align:top"> HEAL FREQUENCY <div class="dd-description" style="display:inline-block;width:150px;text-align:left;padding: 3px 0 3px 6px;border-left: 1px #528e52 solid;vertical-align:top"> <input type="number" id="FREQ" class="a"> <div class="dt-term" style="display:inline-block;width:120px;text-align:right;padding: 3px 8px 3px 0;margin: 0 -6px 0 0;border-right:3px #528e52 solid;font-weight:bold;vertical-align:top"> Total Heal <div class="dd-description" style="display:inline-block;width:150px;text-align:left;padding: 3px 0 3px 6px;border-left: 1px #528e52 solid;vertical-align:top"> <button onclick="calculate"> Calculate