The mortgage has nothing to do with it.
If the open-end obligation is modified into a closed-end obligation then you have a refinancing.
From the Commentary to 1026.40:
iii. If the consumer and creditor enter into an agreement during the draw period to repay all or part of the principal balance and the amount of available credit will not be replenished as the principal balance is repaid, the creditor must give closed-end credit disclosures pursuant to subpart C for that new agreement. In such cases, subpart B, including the substantive rules, does not apply to the closed-end credit transaction, although it will continue to apply to any remaining open-end credit available under the plan.
_________________________
The opinions expressed are mine and they are not to be taken as legal advice.