If that was written for a P3, it has flaws.
Low Battery warning is adjustable in app. It's just a warning, no action taken.
RTH is variable depending on conditions. If you're far enough, it will trigger even before Low Battery setting.
Critical Low Battery setting is adjustable in app, but no lower than 10%.
There's no such thing as sport mode on a P3. Sport was introduced in
P4. Besides, sport mode speed is not used with RTH, actually slower.
There's a difference between cancelling a mode, which I agree you can't do with critical battery landing and overriding its effects with the sticks.