Update a date field based another date with a before date

Update a date field based another date with a before date

In our business we set a training date in the future that requires the customer to upload files prior to the training date so we have a "file upload deadline" date. I have attempted my first deluge script but get an error for line 2 (see attached screenshot). Any help is appreciated.

Goal: To have a the deadline date field populate a date that is 10 days minus the training date field 
Deadline date field name is:  1st Review Deadline
Training date field name is: 30 Day Webinar

Deluge Script

void workflowspace.referenceDate(int potentialID,date modifiedTime,date referenceDate,string 1st_Review_Deadline)

{

    referenceDate = input.referenceDate;

    modifiedTime = input.modifiedTime;

    modifyMonth = modifiedTime.getMonth();

    referenceMonth = referenceDate.getMonth();

        if(referenceDate.getYear()  <  modifiedTime.getYear())

        {

            referenceDate=referenceDate.addMonth(1);

            

        }

        else

        {

            if((referenceDate.getYear()  <=  modifiedTime.getYear())  &&  (referenceMonth.toDecimal()  <  modifyMonth.toDecimal()))

            {

                referenceDate=referenceDate.minusDay(10);

                info "Month" + referenceDate;

            }

            else

            {

                if(((referenceDate.getYear()  <=  modifiedTime.getYear())  &&  (referenceMonth.toDecimal()  <=  modifyMonth.toDecimal()))  &&  (referenceDate.getDay()  <  modifiedTime.getDay()))

                {

                    referenceDate=referenceDate.minusDay(10);

                }

            }

        }

    

    potentialUpdatedResponse = zoho.crm.updateRecord(“Deals”,input.potentialID.toString(),{input.fieldNameToUpdate:referenceDate});

    

}