Add modifier to all objects and change modifier-property
You have two problems.
First you are looping through all the objects, not just the mesh objects. So for example when the loop gets to a camera  it can not add the decimate modifier, and the script brakes.

Second issue with the data not being available (modDec.face_count). This is yet another scene update issue. 

Here is the changed code.

import bpy

for obj in bpy.data.objects:
    if obj.type == "MESH":
        modDec = obj.modifiers.new("Decimate", type = "DECIMATE")
        bpy.context.scene.update()

        while modDec.face_count &gt;= 1000:
            modDec.ratio *= 0.5
            bpy.context.scene.update()


Notice the if obj.type == "MESH": simple if statement that is only working on the mesh objects.

The real change is the two bpy.context.scene.update() lines. You need two because of the while statement.
Last thing I changed is your if(modDec.face_count &gt; 1000): line. You need to keep changing the ratio while the face_count is bigger then 1000.

The way you were setting the ratio it did not actually get the face count down below 1000.