When running on a treadmill without the possibility to connect it to your Garmin watch, you might want to modify the pace and gradient that was set on each lap.
The script modifies the tcx file called my_activity.tcx and writes my_activity_corrected.tcx
Tested with a tcx file generated by a Garmin Forerunner 245 program version 12.0.