I can muddle through HTML and CSS, but scripting is not my forte... Okay, so what I'm hoping to do is automate the ThAC0 calculation for my AD&D 2nd Edition Campaign... I have the HTML and CSS all built so that each class group has it's own level attribute, the sheetworker function I'm envisioning would need to take each class level and calculate the ThAC0 for each then pass the lowest one to the character's ThAC0 attribute. The tricky part is handling Dual-Class characters. For this I have a checkbox set up which when checked causes radio buttons to be displayed next to the class group names so they can indicate their current class group. The Sheetworker would then first check if there are any other class levels that are higher than the current class, if so it would only use the class ThAC0 which is marked as current. If the current class is the highest level it would calculate according to the standard formula. Actually the Dual class check gets processed first, but anyhow.... I've muddled through building a custom attack template to pull all of the attributes and using helper functions to perform the logic tests it then uses whichever formula is appropriate. Then apply that to the attack roll when the template displays in chat. I've got three problems with it though. First: the formula is gawd-awful long and miserable to read when it does display (when hovering over the roll result), and Second: my players end up looking at this crazy spaghetti formula in their ThAC0 field instead of being able to see the actual value; and Third: the template takes forever to run because it's using so many dang helper functions and inline rolls that are nested 4 deep.... Here are the attribute names being used followed by the appropriate ThAC0 formulas: level-W   [ 21-@{level-W} ] ( Warrior group level ) level-C    [ 22-(ceil(@{level-C}/3)*2) ] ( Cleric group level ) level-R    [ 21-(ceil(@{level-R}/2)) ] ( Rogue group level ) level-M   [ 21-(ceil(@{level-M}/3)) ] ( Mage group level ) level-P    [ 21-(ceil(@{level-P}/2)) ] ( Psionicist group level ) dualClass     ( attribute of Dual Class Checkbox ) dualCurrent  ( attribute of currently selected level, value options are W, C, R, M, P ) ThAC0    ( The Golden Goose ) Many thanks in advance if anyone can help me with this riddle!