Skip to content

Instantly share code, notes, and snippets.

@alexloney
alexloney / README.md
Last active February 22, 2026 03:12
Simple JS code to inject into Roll20 to automatically update spell attack, save, school, and damage

Roll20 Pathfinder 2e Spell Updater

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".

Configuration

At the very beginning of the script (or bookmarklet), there are two variables you can change:

  • DANGEROUS_SORCERY: Set to true to automatically add the spell's level to the damage MISC field. Set to false to 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.