Zoho Books - How to Invoke a Custom Function in Schedulers

Zoho Books - How to Invoke a Custom Function in Schedulers

We have multiple schedulers that send emails to customers in batches. Currently, we are maintaining the same code across several schedulers.
Is it possible to use a custom function inside a scheduler script? If yes, how can we invoke the custom function within the scheduler to avoid code duplication?