Layer count from 0 vs 1 between marlin and slicer
When controlling post processing G-code TweakAtZ 5.1.2. The target layer (n) selected by cura is actually n-1.
Example: If a function is expected to execute on layer 30 based on Cura, it will actually run on layer 31 when executed on the printer. The user must select layer 29 for a function to properly execute on layer 30.