I get migraines and a lack of caffeine is definitely a trigger. I drink a cup after I get through the airport security while waiting for my first flight - always there extra early! When I have the meal on the plane, I have one small cup and drink a lot of water throughout the flight. When breakfast is served, I have another small cup. (When we flew to Cambodia, the flight attendants didn’t have coffee, and my head was hurting!)
For switching over to the time zone after arrival: my head tells me when it’s regular coffee time, regardless if it’s still very dark outside! I always bring some instant coffee sticks and a silicone collapsible cup. I try to wait two hours after my head says “coffee” to make a cup with the hottest water available in my hotel room. Then a few hours later, I have an espresso with my European breakfast. By Day 3, I’m fine not having the supplemental cup. (I’ll use some of my coffee sticks if I ever am on a plane again where I can’t get a cup of coffee.)
For me, having a Coke gives me a headache and also chocolate doesn’t balance it out well - probably because they both have sugar which I don’t eat in the morning. Try whatever you’re planning as a substitute ahead of time to ensure you’re not causing a new issue.