I am trying to set up a javascript "If" formula on a form and keep running into errors.
Good Morning/Afternoon!
I am trying to set up a calculation on a form that is based of an "if/Else" format. The calculation in words would look something like this:
Skill Calculation:
If “Trained Skill 1”>0;
“bonus 1 = “Dex Mod” + “Trained Skill 1” + “Skill Misc Mod 1” + “Addtl Misc Mod 1”
Else
“bonus 1” = 0
If it were in excel it would look like this as far as format and expected outcome:

As you can see from the Excel snip, Row 2 shows that C1 ("Trained Skill 1") has a 1 in the column. As a result, the sum of B2 ("Ability Mod"), C2 ("Trained Skill 1"), D2 ("Skill Misc Mod 1"), and E2 ("Addtl Misc Mod 1") is calculated and placed in A1 ("Bonus 1")
Conversely, Row 3 shows that C2 ( "Trained Skill 1") has a 0 in the column. As a result, the sum of B2 ("Ability Mod"), C2 ("Trained Skill 1"), D2 ("Skill Misc Mod 1"), and E2 ("Addtl Misc Mod 1") is NOT calculated and a 0 is placed in B1 ("Bonus 1")
Can anyone help me create a javascript formula depicting this action? I cant seem to get a working script.
Thank you tremendously in advance!
Best!
JLD
