ok what I mean is, make a weapon that does no dammage and is not visable (you could have a firging sound tho) and that AI will try to fire on ships with. Then, make a fired eventhandler in the config of the sub for that weapon:
_this addeventhandler ["Fired",{ [_this,TORPEDO] exec "\CoC_Torpedoes\init\switchSea.sqs"}]
where TORPEDO is the CoC torpedo... ex: CoC_Mk48
if you can get the AI to fire any weapon at ships, attach that eventhandler to it. You see, the weapon you made is really fake, even tho thats accualy whats being "fired", the eventhandler will stick a CoC torpedo in its place. Therefore, of the AI fires a fake weapon AT a ship, a torpedo will fire instead and hopefully hit the ship.