Find a live TrackerActionModel across all downs.
Find a live CombatDownModel by its downNumber.
Find a live TrackerEffectModel across all downs.
Find the index of the first non-empty down after index 0, or -1 if none. Used by advanceToNextResolution to determine step count.
Get down-0 actions that are due to resolve (resolutionTime <= 0) but
haven't resolved yet (resolved !== true). This is the exact state a
natural advance's decrement/sweep loop (_processCombatSteps in
module/documents/combat.mjs) would unconditionally decrement to -1
and sweep out of the persisted downs array on its next call — the
root cause of the data-loss bug resolveCurrentDown() exists to make
unreachable (see .claude/contexts/combat.md → "Resolve Mode vs Advance
Mode"). Used both by BodyMindSoulCombat#resolveCurrentDown() to find
what to resolve, and by the advance-guard in advanceTracker()/
advanceToNextResolution() to refuse to run while any exist.
Two exclusions, both required to avoid gating on entries that can never
transition to resolved: true through the real resolve pipeline (which
would otherwise permanently deadlock the advance guard):
hold-type actions: a hold intentionally sits pinned at
resolutionTime === 0 with resolved permanently false (see
ResolvePass#markResolved's hold exemption).actionItemId and not the surveyEnvironment pseudo-
action: BodyMindSoulCombat#resolve() only ever resolves (and calls
pass.markResolved for) actions matching a?.actionItemId || a.embeddedActionId === "surveyEnvironment" — everything else is a
bookkeeping-only tracker entry (e.g. a backswing marker) that's
meant to simply decrement to -1 and sweep out naturally on a normal
advance, never routed through resolve/markResolved at all.Live tracker action instances on down 0 that are genuinely stuck due-and-unresolved, excluding holds and non-resolvable bookkeeping entries.
StaticdefineStaticredistributeRedistribute all actions and effects in a plain-object downs array to their correct down slots by resolutionTime. Mutates the array in place. Called from _preUpdate before Foundry validation.
Plain-object downs array from toObject()
Classify which actions and effects are affected by advancing
stepsdowns. Returns live DataModel instances so callers can use .actor, .combatant, etc.