"if the force is not derived from a potential, then the system is said to be polygenic and the principle of least action, that the action integral $S$ is stationary at the actual path followed is equal to 0".
However The euler equations for such systems can be found using d'Alembert's principle and look something like this: $$ \frac{d}{dt}\frac{\partial L}{q'} = \frac{\partial L}{dq}+ Q_i.$$
My understanding of this statement is that euler-lagrange equations in their natural form do not apply to non-conservative forces, that is, magnetic forces (velocity dependent), dissipative forces and forced motion for which the euler-lagrange equations need to be rewritten
However another statement (John R. Taylor, Classical Mechanics, p.272)
For a given mechanical system with generalized coordinates $q=(q_i,.... q_n)$, a Lagrangian $L$ is a function $L(q_i,...,q_n,\dot{q}_i,...,\dot{q}_n,t)$ of the coordinates and velocities such that the correct equations of motion for the system are the Lagrange equations $$ \frac{\partial L}{\partial q} = \frac{d}{dt}\frac{\partial L}{\partial\dot{q}}.$$
He then proceeds to find the Lagrangian for a charge in a magnetic field that do satisfy the euler-lagrange equations.
What confuses me is that, the first statement states that the euler-lagrange equations are only valid for conservative systems or, at a minimum, that they satisfy the second condition of conservatism (that the force is derivable from a potential energy). However on the second statement, it states that any system can satisfy the euler lagrange equations in the form $ \frac{\partial L}{dq} = \frac{d}{dt}\frac{\partial L}{q'}$" given the correct Lagranian $L$. This confuses me a lot.
From my own research I have found that the motion of a charged particle in a magnetic field can be solved using the euler-lagrange equations $$ \frac{\partial L}{dq} = \frac{d}{dt}\frac{\partial L}{q'}$$ using the Lagranian $\frac{1}{2} mr'r' - q(V-r' A)$ , however for other systems that contain forces like friction then the euler equations have to be rewritten as $$ \frac{d}{dt}\frac{\partial L}{q'} = \frac{\partial L}{dq}+ Q_i.$$
Why in this case can the euler-lagrange equations be used for magnetic force given the right L but not for dissipative force even thought both are non-conservative (Why instead of rewriting the the euler-lagrange equations for dissipative force can't we find an appropriate Lagrangian like we did for the magnetic force). Is there some factor that determines when exactly the euler equations need to be rewritten.