is it possible to have a scoreboard that detects if its raining or thunderstorming?

I need a way to make it possible to detect when its thunderstorming: id want it to fit into a command like this as an "if" component smiliarly to the "if items entity @s armor.head carved_pumpkin[minecraft:custom_model_data=2] " execute as @a[scores={scubajets=1..}] if items entity @s armor.head carved_pumpkin[minecraft:custom_model_data=2] run function pine:underwaterjets
Continue to help post