We investigate to derive off-shell invariant twisted super Yang-Mills for N=2 in 2-dimensions and N=4 in 4-dimensions with a central charge by super connection ansatz formalism. We find off-shell invariant N=2 algebra with and without an extra constraint in 2-dimensions. On the other hand in 4-dimensions we find off-shell invariant N=4 twisted SUSY algebra including one central charge always with a constraint.