Yes. While there are certain ordering rules for applying capital losses against capital gains, ultimately, long-term capital losses can offset any short-term gains.
This is generally adjusted gross income increased by certain items such as tax-free foreign earned income. MAGI usually is used to determine phaseouts of certain deductions and credits.