Auto update Chq/Reference date from Entry date

Hi,
In Payment Entry I want to auto update Chq Date to Entry/Posting Date only when Chq Date is blank.
The updation should be done only when Entry/Posting date is updated.

Please suggest custom script for same.