To the third one proceeds thus. It seems that it is not part of the notion of virtue to be good habitude. For sin is always drawn from bad. But there is also in sin some virtue; according to I Cor XV, the virtue of sin is law. Therefore virtue is not always good habitude.
Further, virtue relates to power. But power does not only have itself toward good, but also toward bad; according to Isaiah V, Woe to you who are powerful toward drinking wine, and strong men to mixing drunkenness. Therefore virtue also has itself toward good and toward bad.
Further, according to the Apostle, II Cor XII, virtue is completed in weakness. But weakness is a sort of badness. Therefore virtue does not have itself only toward good but also toward bad.
But contrariwise is what Augustine says, in the book on the customs of the Church, that no one doubts that virtue makes the soul optimal. And the Philosopher says, in Ethic. II, that virtue is what makes the one having it good and renders his work good.
I reply that it must be said that, as was said above, virtue implies completion of power, whence the virtue of anything is determined to the limit in which that thing is able to be, as is said in On the Heavens I. Now the limit in which whatsoever power is able to be needs to be good, for every bad implies a sort of defect; wherefore Dionysius in De Div. Nom. chap. IV says that every badness is weak. And according to this it is needful that virtue be said of whatever thing in terms of ordering to good. Thus human virtue, which is working habitude, is good habitude, and working of good [bonus habitus et boni operativus].
To the first therefore it must be said that, as complete, so also good is said metaphorically of bad things, as is said of a complete thief or robber and a good thief or robber, as is clear from the Philosopher in Metaphys. V. According to this, therefore, virtue is also said metaphorically of bad things. And thus the virtue of sin is called law inasmuch as sin is occasionally increased through law, and as it were comes to the maximum of its ability.
To the second it must be said that the badness of drunkenness and excessive drinking consists in a defect of rational ordering. But it happens, with defect of reason, that there is some inferior power complete as to its own kind, even with repugnance to or defect of reason. But completeness of such power, because it is with defect of reason, is not said to be human virtue.
To the third it must be said that reason is shown to be more complete the more it can overcome or endure the weakness of the body and the inferior parts. And therefore human virtue, which is attributed to reason, is said to be completed in weakness, but weakness of body and the inferior parts.
[Thomas Aquinas, ST 2-1.55.3, my translation. The Latin is here, the Dominican Fathers translation is here.]