It hsa to be done from scratch. Though I doubt it can be a general include file for any PIC chip.

Better use a chip with higher PWM resolution.

Ioannis