Hi
So i have been reading the rules regarding your question and it seems forum does not allow the modification of scripts that are not yours.
Releases Rules and F.A.Q at Credits & Copyright/DMCA in the firts paragraph , it advises to contact the author of the script using is github info or something asking for a permit to change/improve the code.
Can you tell me where did you get both scripts ?
Thanks in advance