Changes to AOS_Invoices.php in an upgrade safe way

Good morning,
how can i make changes to modules/AOS_Invoices/AOS_Invoices.php in an upgrade safe way? :dry:

Any step by step guide would be appreciated.

Thanks in advance

Fabrizio