Thanks for replying!
>> First, how badly do you need to learn this language for your research? <<
I'd say it's of moderate usefulness. I focus on a nearby country, so it'd be useful though not absolutely necessary.
>> Second, can you identify why you're struggling? <<
Unfortunately, no. It'd be easier to fix the problem if I could!
>> Third, have you talked to the professor about how you're doing and if you should drop the class? <<
The professor is leaving it up to me but noted what I already know - getting a bad grade looks bad, but dropping a class can too.
As for the last, yes, unfortunately it does count for my degree and GPA; some of our coursework for the program is composed of undergraduate courses (with extra work, of course).