It is not completely but part of the reason Japan wants to defend it's currency is inflation because of increase in energy prices.
The devaluation of the Yen against the dollar (from the typical 110:1 to these days 150:1) started around 2021 and has been a source of angst in Japan for quite some time. People were complaining about it constantly when I was last in Tokyo in December 2025, when oil was at $70/barrel.
In the sense that weak currency makes everything you buy from foreign partners more expensive, sure.
The place where you go wrong is drawing a straight line to the US actions in Iran. They’re not directly connected.