verb
adapt
uh-DAPT/əˈdæpt/
to change or change something to suit new conditions
She adapts the jacket sleeve to fit around the cast.

Etymology
The pieces express fitting or joining something to something else. The meaning extends from making something fit a purpose to changing so as to fit new circumstances.
In context
you need to be flexible enough to adapt your script to changing situations