I don't know how skilled the Iranians are, but those Kilo's are much better suited to the Persian Gulf than the US Navy. Detecting submarines in shallow water like the Gulf is very difficult, and Kilo's are quiet. Similar Western subs have repeatedly 'sunk' US carriers during exercises. Most likely those crews were better trained, but they also had the disadvantage of operating in more open water. If I remember correctly, before the '90/'91 Gulf War the US Navy refused to even operate carriers in the Gulf.
If the US attacks Iran while the latter has one or more subs on patrol, there's a significant chance the US Navy will lose one or more ships before they manage to sink the sub. The possibility should not be discounted.