Given an equation with multiple variables, all integers, how would I minimize an extra variable (also an integer)? Consider:
$$2x + 4y + 8z + w = 75$$
Or more accurately for what I want to deal with:
$$nx + oy + pz + w = q$$
Where $n$, $o$, $p$, and $q$ are all positive integers and constant, and $x$, $y$, and $z$ are the variables being adjusted, also all positive integers. $w$ should also be a positive integer.
How would I find, whether it's an algorithm or something purely mathematical, a way to minimize $w$? That is, find the combination of values of $x$, $y$, and $z$ that results in the smallest possible $w$?
Example:
$$14x + 60y + 17z + w = 723$$
This has 20 answers, as an example one of them is $x=9, y=4, z=21$ where $w = 0$.
I think it could also be thought of like this:
$$f(x,y,z) = -nx - oy - pz + q$$
Find values of $x$, $y$, and $z$ at a minimum of $f(x,y,z)$.

Find the greatest common divisor $d$ of $n$, $o$ and $p$.
See how often $d$ goes into $q$. That is, write
$$
q = Ad + R
$$
with quotient $A$ and remainder $R$.
Then $Ad$ can be written as an integer combination of the integers $n$, $o$ and $p$ and is the largest such number, so $R$ is the $w$ you seek. (In your example it's $0$ since 14, 60 and 17 have no common factor so $d=1$.)
If $q$ is large enough then $x$, $y$ and $z$  can be chosen to be positive. If $q$ is not big enough you will have to do a little more work.
There are algorithms for these calculations. Look up the extended Euclidean algorithm in wikipedia, scroll down to
The case of more than two numbers.
