Last time I did the "get off coffee to show myself that I can" thing, I was able to avoid the terrible headaches by pushing the "first sip" time back a bit each day, then reducing the amount. Initially about 11AM was the headache onset time, but after I moved my first sip back each day for a week, I found that I didn't get the headache onset till about 3PM. Then I reduced down the dose over the next week, which more motivated by the annoyance of mentally tracking "when can I (do I have to) have my coffee today". The two stages separated the task of having my brain produce its own wake-up/alertness state from dealing with the other withdrawal symptoms; and it turned what was a comforting morning ritual into a chore taking up time and attention.