Short version: they can't take the scholarship away from you. But do your best to pass those classes.
Now, your situation is this: you're attending a yearly Japanese language and culture course. Each university has different requirements for passing the course - your university should have clearly informed you about theirs. Anyway, if you fail to fulfil those criteria during two semesters, you fail the course and have to return the whole yearly amount of scholarship to MEXT. I never heard of this happening in real life, most probably because (Japanese culture specifics follow) a student's failure is also an university's failure, and, of course, MEXT gets to know about it, so it makes universities look bad. Therefore, universities will do what they can to drag those students out of the crap they have gotten themselves into.
This is based on my experience as a nikkensei at Saitama University, 2007/2008. Don't think much has changed about the program as a whole (I might be wrong), but definitely check your university requirements - 10 classes during one semester is a lot, I was expected to pass 8 during two semesters. And, unless your university's requirements are really strange, you can make up for those failed classes in the summer semester. But you'd prefer to have little to do and worry about during Japanese summer, trust me.