# Ordinary healing and Healing Magic passives

Static native audit of Steam demo build 24032336. This is suitable for a single-target Cure benchmark; it is not a simulator for all healing skills, status effects, or party-wide recovery. Raw instructions: `healing-native.txt`. Extracted recovery profiles: `healing-calc-profile.json`.

## Cure benchmark

Cure (210010) has power 200, skill attribute 4 (Magic), skill effect 1 (parameter variation), variation 0 (increase), parameter 1 (HP), calculation type 2, and MP cost 6. Its native `isApplyAllMag` flag is zero. It has no intrinsic additional effects.

For an ordinary living, eligible ally with sufficient missing HP, excluding special recovery-rate effects:

```
r = caster Sanctity / 256
G(r) = 1 + r                     when r < 1
     = 4 / (1 + exp(1 - r))      when r >= 1

potential healing = Power * G(r) * (1 + sum(healing bonuses)) * variance
variance = 0.95 + 0.10 * N / 32767, N uniformly in 0..32767
```

Native uses float32 operations and small epsilon constants around 1. A normal explanatory/optimizer expectation can omit them while clearly omitting final integer truncation. The mean variance is approximately 1. Final amount is truncated to an integer and capped, normally 9999 for a player caster. Actual HP restored is then bounded by the recipient's missing HP, except separately handled overheal cases. Thus label the metric **potential healing** or **expected Cure healing**, not actual restored HP without a recipient deficit.

Examples before variance and final truncation: Sanctity 0 => Cure 200; Sanctity 128 => 300; Sanctity 256 => 400. The curve approaches 4, so the benchmark's unmodified amount approaches 800 at very high Sanctity.

Reference checks for the optimizer: Sanctity 128 with Healing Magic +10% => 330; +30% => 390; both distinct effects => 420. Changing enemy defense, enemy level, or critical chance must not change this Cure benchmark. Changing caster level has no direct factor; recomputed Spirit/Sanctity growth can change the result.

Sanctity is computed from full Spirit plus flat Divine/Sanctity equipment contributions and any applicable own Sanctity modifier; it is not raw Magic. The detailed native stat assembly is recorded in `calculator-stat-rules.md`. Existing MP-cost rules apply to Cure's base cost 6, subject to each modifier's skill attribute/healing gates.

Native evidence:

- Ordinary recovery dispatcher `0x145227bc0` loads `DT_SkillRecoveryCalcData` (table type `0x23`) according to the skill calculation type.
- Calc types 1 and 2 enter the ordinary curve at `0x145227e35`.
- `0x145227e43` calls Sanctity getter `0x14522cc60`. That getter assembles parameter ID 16, confirmed independently as Sanctity/Divine in the stat report.
- `0x145227e74` divides by `UNIT_PARAMETER_CALC +0xd8`, whose extracted `baseRecoveryCalcFactor` is **256** (`unit-parameter-calc.json`).
- `0x145227e7c` obtains the skill power through `0x1452319c0`; its additional source/target power modifiers are separate from Healing Magic passives. Cure has no intrinsic modifier.
- `0x145227e81..0x145227eba` applies the two-branch recovery curve. The upper branch computes `4 / (1 + exp(1-r))`.
- `0x145227ec5..0x145227eec` applies the same 15-bit random variance family, using the extracted 0.05 magnitude.
- `0x14522811e` truncates the final float; `0x145228126..0x145228131` applies caster cap getter `0x14522f950`.

The recovery profile for calculation type 2 enables skill power, random, skill effects and additional-turn handling; it disables element, crit and defense calculation. Do not apply the outgoing HP-damage ratio curve, enemy defense, crit chance, or a level multiplier to this Cure formula. Level can still improve healing through growth in Spirit/Sanctity.

## Healing Magic +10% and +30%

Passives 1282 and 1375 use effect type **49**, DamageIncOnSkillAttribute, with effects 1387 and 1434. Parameters begin `[110,2,4]` and `[130,2,4]`.

Handler `0x145108940`:

1. Matches the skill attribute against the effect's cached attribute list (built from parameters 2 onward; Magic=4 for these passives).
2. Parameter 1 selects damage/healing applicability. The ordinary healing caller passes false, which accepts mode 2 and rejects mode 1.
3. Returns `parameter0 * 0.01 - 0.9999998807907104`, approximately **0.10** or **0.30**.

The ordinary healing caller initializes the attribute bonus accumulator to 1 (`0x145227f70`), then **adds** each effect return at `0x145227fb6`, finally clamping that accumulator to at least 1 (`0x145227fc3`). Consequently, distinct +10% and +30% effects combine to approximately **1.40**, not 1.43. The resulting factor multiplies the already curve-scaled healing amount at `0x14522800a`.

Duplicate passive/effect identity still needs the calculator's existing conservative deduplication rule. This native additive accumulator does not prove that duplicate copies instantiate duplicate effects.

## Additional boundaries

- Other recovery-rate effects are multiplied through a separate virtual slot `0x520` at `0x145227f4c`. Do not fold unexamined effects into the attribute bonus bucket.
- Generic `DamageMultiplier` (effect 98) and `DmgMulElement` (effect 184) do **not** supply bonuses through this ordinary healing path. Their class vtables at file offsets `0x868f718` and `0x869d580` have defaults at healing-relevant slots: `0x460` returns 0, `0x520` returns 1, and the power-adjustment slots `0x598`, `0x5a8`, `0x5b8` return 0. The generic HP-damage accumulator is not called here. Do not apply physical/magic Attack +%, elemental damage +%, crit bonuses, or Hone's damage bucket to Cure.
- The area helper `0x14522ad20` multiplies by 0.4 only when the skill's `isApplyAllMag` flag is set and no ignore-area effect applies. Cure has the flag off. Party-wide healing is not automatically an unpenalized multiple of Cure.
- The skill's raw power can be modified by separate source/target power effects in `0x1452319c0`; these are not all generalized in this bounded audit.
- Undead reversal, recipient recovery blocks, special guest behavior, excess-HP mechanics and special/fixed/percentage recovery paths are outside the ordinary living-ally benchmark.

## Builder recommendation

Prefer **Expected Cure healing** over a vague healer score based on MP or Spirit alone. Use the actual Cure unlock/current-vision/AP rules; do not let a character cast Cure for free merely because the benchmark exists. Secondary priorities such as MP, survival or Speed can break ties explicitly. If the builder must avoid binding the benchmark to an equipped skill, call it **Healing potential (Cure reference)** and state that it measures gear/passive effectiveness, without claiming that Cure is presently equipped.
