This script automates updating the MISC modifier fields for Spell Attack, Spell DC, and Damage (for feats like Dangerous Sorcery) across all standard spells on the official Roll20 Pathfinder 2e character sheet. It dynamically calculates the difference between your base stats and your target stats (from runes or temporary buffs) and injects the proper math so you don't have to manually edit every spell.
It intentionally ignores "Innate Spells" and "Focus Spells".
At the very beginning of the script (or bookmarklet), there are two variables you can change:
DANGEROUS_SORCERY: Set totrueto automatically add the spell's level to the damage MISC field. Set tofalseto reset the damage MISC field to 0.MAGIC_TRADITION: Change this to'arcane','divine','primal','occult', or''(e.g. empty string) depending on your caster.