TLDR: following this unity forum thread, I just followed what polemical said which was to
in Project window, right-click the package, select
"Show in Explorer". Then copy that package to another folder outside
the project structure, then in Package Manager click the + and click
"Add package from disk" and browse to the package.json of your copy -
whatever changes to that won't be overwritten.
I tried to wrap my head around creating a script to modify the script but I'm a bit short on time. For now, this is the answer as also suggested by Benjamin.
If there's a better solution, I can mark that as an answer.
update 1: Since we're using a repository to handle the code, selecting the custom unity package locally is not advisable as Unity will crash upon startup because it can't locate the file in someone else's computer. to fix this, we had to create a repository that each one of us can access. Remove the local unity package and add the custom package using git url. the problem will be fixed