Edit cookie expiration time with Password Protect

I would like to be able to edit the amount of time before the cookie expires and the user will have to re-enter their password. I can see where I can do this on the plugin page but any updates to the plugin could erase my edit. Is there some script that I can add to my function.php file in my child theme that can do this?