Asking for gratuity while he is in the job, will actually be your friend's loss because gratuity is calculated on the basis of last basic salary.

However, he may ask for salary advance from his company.
Normally, company would not refuse giving him at least one month salary as advance, as in worst case the company can recover it from his last month salary and gratuity after resignation/termination.

Company can deduct a fixed amount on monthly basis from subsequent monthly salaries.