Attached is a useful document with detailed examples of HPSP payback obligation. In a nutshell, internship is dead time. Operational time subtracts from the obligation. Residency time adds to the obligation if the number of years of training exceeds the number of years owed at the start.
The document makes no mention of the statutory service requirement that has to be made up with inactive or active reserve time.