YOU SAID:
John took his hat off when saying goodbye to Jane.
INTO JAPANESE
ジョンはジェーンに別れを告げるときに帽子を脱ぎました。
BACK INTO ENGLISH
John took off his hat as he said goodbye to Jane.
INTO JAPANESE
ジョンはジェーンに別れを告げながら帽子を脱ぎました。
BACK INTO ENGLISH
John took off his hat as he said goodbye to Jane.
That didn't even make that much sense in English.