Piracy was pretty much universal, true. But it impacted trade, not war-fleets, which pirates stayed the Hell away from. Only Early Modern "pirate states" like the city-havens of the Barbary Corsairs or the fig-leaf "privateers" of the Europeans (whose vessels tended to be little short of privately owned and at least partially state-backed warships themselves) had afloat enough ironmongery to even consider taking on military ships, and normally preferred to rather chase merchantmen anyway.