The Lagrangian equation is $$\frac{d}{{dt}}\frac{{\partial L}}{{\partial {{\dot q}_j}}} - \frac{{\partial L}}{{\partial {q_j}}} = {Q_j}$$ Following D'Alembert's Principle $$\left( {\frac{d}{{dt}}\frac{{\partial T}}{{\partial {{\dot q}_j}}} - \frac{{\partial T}}{{\partial {q_j}}}} \right) - {Q_j} = 0$$ When $Q_j$ fits one of the following two conditons the Lagrangian is in the form $L=T-U$, with $U$ being the potential $$ {Q_j} = - \frac{{\partial U}}{{\partial {q_j}}}\\ \ \\ \text{or}\\ \ \\ {Q_j} = - \frac{{\partial U}}{{\partial {q_j}}} + \frac{d}{{dt}}\frac{{\partial U}}{{\partial {{\dot q}_j}}} $$
Suppose now I manually define a scalar term $C(\{q_i\},\{\dot q_i\},t)$ such that
$$ {\frac{d}{{dt}}\frac{{\partial (T - C)}}{{\partial {{\dot q}_j}}} - \frac{{\partial (T - C)}}{{\partial {q_j}}}} = {Q_j} - \frac{d}{{dt}}\frac{{\partial C}}{{\partial {{\dot q}_j}}} + \frac{{\partial C}}{{\partial {q_j}}}$$
and rewrite the above equation into the following form:
$$ {\frac{d}{{dt}}\frac{{\partial (T - C)}}{{\partial {{\dot q}_j}}} - \frac{{\partial (T - C)}}{{\partial {q_j}}}} = Q_j'$$
I can again obtain an expression similar to the lagrangian equation
Now can I choose this $(T-C)$ term as my Lagrangian of the system and treat $Q_j'$ as some kind of friction?
Does this mean: there alway exists a Lagrangian in the form of $L=T-C(\{q_i\},\{\dot q_i\},t)$, where $C$ contains no algebraical rewrite of $T$?
(By not an algebraical rewrite I meant $C \ne aT^b+k$)