The hosting Baggies raced into a 2-0 lead within the opening 33 minutes courtesy of goals from Peter Odemwingie and Cox.
However, former West Brom striker Rob Earnshaw reduced the arrears just three minutes later to take the sides into the break 2-1.
Cardiff came out after the restart in the ascendancy and drew themselves level in the 50th minute when Joe Mason converted a pass from Earnshaw.
Both teams had chances to score the tie's fifth goal, with both goalkeepers being called into action.
It was West Brom who claimed the all-important next goal when substitute Marc-Antoine Fortune found Cox on the edge of the area with 61 minutes played. The striker took control of the ball before curling his shot beyond the reach of Tom Heaton.
Cox rounded off the scoring and completed his hattrick in stoppage time when he turned in a cross from striker partner Odemwingie.