Provided further, where the alleged violation is sustained and the court continues or modifies the sentence, the court may also extend the remaining period of probation up to the maximum term authorized by section 65.00 of the penal law. Provided, however, a defendant shall receive credit for the time during which he or she was supervised under the original probation sentence prior to any declaration of delinquency and for any time spent in custody pursuant to this article for an alleged violation of probation.
N.Y. Crim. Proc. Law ยง 410.70