The assassination of the archduke was like flipping a light switch in a house saturated with gas. Austria declares war to Serbia, which is defended by Russia, so Germany has to declare war to Russia; Germany expects France to join Russia so they declare war to France, but their battle plans to conquer France require passing through Belgium. The UK needs Belgium to remain neutral, so they declare war to Germany... and so on. Once the wheels are in motion, and everyone is ready for war, war just happens - whether coke is there or not.
[0] https://www.pbs.org/wnet/secrets/preview-world-war-speed/433...
[1] https://en.wikipedia.org/wiki/History_and_culture_of_substit...
[2] https://commons.lib.jmu.edu/cgi/viewcontent.cgi?article=1127...
https://www.amazon.ca/Blitzed-Norman-Whiteside-Shaun-Ohler/d...
They say Hitler was very charismatic, inspiring and a great public speaker. I seriously wonder how much drugs he was on at the time and how much that boosted and projected his own confidence (and then subsequently inspired all of his fellow countrymen Germans)?
With Germany having major role in both modern drug history (e.g. Merck with morphine and cocaine, Bayer with Heroin) and their decisive role in the beginning of WW1, I think it is legitimate to ask if substance abuse had role in the hawkishness of German leadership.
Quick Google indicates that there is no strong evidence for Wilhem II themselves using significant amount of drugs, but less is known about the other high officials and generals.
For a war to start, you need 3 things: materiel, political support, popular support. In 1914 both the Central Powers and the Entente had all 3 criteria satisfied. The war ended when the Central Powers ran out of popular support for the war.
(Not to say that any other nation's leaders were models of wisdom and responsibility.)
I saw a fascinating documentary addressing the fact that the 3 primary leaders of the belligerents in WWI were competitive cousins - amazing that Nicky, George and Little Willi all knew one another as children! And yes, the analysis was that Wilhelm felt excluded and was never very mature - sorry I don't remember the documentary title but there is a summary of the facts here: https://www.bbc.co.uk/history/british/britain_wwone/cousins_...