How to auto tune the trace while the camera zoom in it

Hi folks,

I need to know if there is a script or some module in the module library that automaticaly reduce the thickness of the trace when the camera closes the character on the screen. I mean, I work with cut out animation and sometimes I need to frame the carachter in a superclose cut, but when I approach the camera the stroke is too thick, I want to tune the stroke automatically. I know a script that we can tune the stroke and change all rigging in the scene, but I want to do it gradually and automatically during camera movement.