I just tried a test game where I could continuously hack enemy drones and mecs every turn.
It did not matter whether the hack failed or not. Every time I used Haywire protocol it said that the skill was put on cooldown for 4 turns. The hover-text on the ability says 4 turn cooldown.
Despite all this, I could use it just fine as soon as my next turn started.